SMTP Setup with Drupal Portal and SendGrid

Context

When creating your Developer Portal experience, the engagement with the developers, including their sign up / sign in experience, is quite important. When setting your Apigee Developer Portal using Drupal , you'll have full flexibility into this experience - including setting up SAML and your own SMTP service for emails.

One simple path to experiment setting up your own SMTP service within the Apigee Drupal Developer Portal is using SendGrid. While it has a lot of different email services, the one we'll focus on on this article is the SMTP capability it has. And remember - SendGrid has also a Free version for you to experiment! 

Setting up SMTP for your Drupal-based Apigee Developer Portal

For this article, I'll assume you are using the GCP Marketplace version of the Apigee Drupal Developer Portal - but this should certainly be easily adaptable to any other configuration you might have.

The first step is enabling and installing the SMTP Authentication Drupal module, as depicted at https://www.drupal.org/project/smtp . Using composer for installing the PHP package is usually the recommend approach. Make sure you also enable the module within Drupal in the admin/modules administrative menu.

carloscabral_0-1681924703257.png

Now, on to SendGrid. On their main webpage, sign up and use a Free account. After this setup, the first thing it will require you is to verify the ownership of an email address. This must be a valid email and I recommend to use the email you configured for Drupal Site admin here - so this is the email your Portal will be sending "From" to your developers - but that will be actually delivered by SendGrid!

carloscabral_1-1681924932933.png

Once that's setup, create a SendGrid APIKey - we'll use it for authenticating our Drupal portal with the SendGrid service. 

carloscabral_2-1681925002703.png

With the SendGrid APIKey in your hands (make sure you don't lose it!), go back to the Administration page of your Drupal portal and under Configuration > System, select SMTP Authentication Support.

Now. you can change the configurations for using TLS/SSL, different ports... but a basic configuration that works is the following:

  • Check "Set SMTP as the default mailsystem" to On
  • SMTP Server - smtp.sendgrid.net
  • SMTP Port - 587
  • Username - apikey
  • Password - <YOUR_SEND_GRID_APIKEY_PREVIOUSLY_CREATED>
  • Email from address - your Drupal site admin email
  • Email from name - pick your name that will show up in your emails!

That's it! You can also send a test email after you do this config or Enable Debugging to check for any errors. Make sure you Save your Configuration and you are done!

This is a simple setup, but I hope it helps you out in building your Developer Portal experience with Apigee!

Additional Resources & References

https://www.drupal.org/project/smtp

https://sendgrid.com/blog/create-an-smtp-server/

https://docs.sendgrid.com/for-developers/sending-email/getting-started-smtp 

 

Contributors
Version history
Last update:
‎04-19-2023 10:30 AM
Updated by: