Blog Post

Apps on Azure Blog
3 MIN READ

WordPress on Azure AppService - Email Integration

RadhikaB's avatar
RadhikaB
Icon for Microsoft rankMicrosoft
Aug 03, 2023

The email feature in WordPress is crucial for effective communication and user engagement. WordPress websites often require communication with users for various purposes, such as user registrations, password resets, campaigns, and contact form submissions etc. WordPress on App Service has been integrated with Azure Email Communication service to enable email feature.

 

The email Integration with WordPress on Azure App Service can be achieved in 2 ways:

  1. Newly created sites:  Email integration is enabled and configured out of the box.
  2. Existing WordPress sites:  It needs an explicit integration setup as per the steps outlined below.  

1.    Configuring Email with New WordPress Websites

  • Create WordPress site from WordPress on App Service | Azure portal
  • To enhance the user experience, we have enabled email support for all the SKUs (Basic/Standard/Premium) by default.
  • As a default option, we offer an Azure managed domain for sending emails from WordPress sites. This seamless integration allows you to easily send emails without the need for additional setup. If you wish to use custom domains with your ACS email addresses, please follow the instructions here: https://learn.microsoft.com/azure/communication-services/quickstarts/email/add-custom-verified-domains
  • Below are the Communication Service resources created as part of this deployment:  Azure Communication Service, Email Communication Service, Email Communication Domain

2.     Configuring Email with Existing WordPress Websites

Prerequisites: As a user, you already have an active Azure subscription and an active WordPress site hosted on Azure App Service.

 

(Note: For all the create references below, execute the steps till create/ connect only and do not execute delete/ disconnect actions.)

  1. Create the Azure Communication Resource following quick start guide
  2. Create the Email communication Resource following the quick start guide
  3. Add Azure managed domain to email communication service following the quick start guide.
  4. Connect the azure managed domain with azure communication service resource following the quick start guide
  5. Go to Azure communication service resource and navigate to keys blade and save the primary key and resource endpoint for later use.

  

 

  1. Go to the Azure email managed domain resource, navigate to MailFrom Addresses blade.  Click Add, add the MailFrom address and save it. 

7. Enable managed identity authentication for Azure Communication Services Email

Part 1: Enable managed identity to access ACS Email resource

 

A. Go to Communication service resource > Access Control (IAM)

 

B. Click on ‘+Add’ and ‘Add role assignment’

 

C. Select Privileged administrator roles > Contributor

 

D. Assign access to ‘Managed identity’. Click on ‘+ Select members’. Select the managed identity created in Step 1. Click on ‘Select’.

 

E. Click on ‘Review + assign’

 

Part 2: Add Environment variables

  1. Go to App Service resource > Settings > Environment variables.
  2. Add this application setting:

ENABLE_EMAIL_MANAGED_IDENTITY

true

 

 

Note that ENTRA_CLIENT_ID is a crucial environment variable for setting up ACS Email with managed identity. The details are omitted here as they are already covered in the MySQL configuration section. If you are configuring managed identity solely for ACS Email or have skipped the MySQL configuration, ensure you do not overlook this step.

  1. Download the App service email plugin from here: Click here.
  2. Go to WordPress Admin Dashboard, navigate to plugins tab and then click on add new plugin.
  3. Click on Upload Plugin and upload the App service Email plugin zip file (downloaded in above step).
  4. Install and activate the plugin.

After installing and activating the App service email plugin, your email setup is fully configured and ready to be utilized for sending emails from your WordPress website.

 

Note: If you wish to use custom domains with your ACS email addresses, please follow the instructions here: https://learn.microsoft.com/azure/communication-services/quickstarts/email/add-custom-verified-domains, and here: https://learn.microsoft.com/azure/communication-services/quickstarts/email/add-azure-managed-domains

 

Support and Feedback 

In case you need any support, you can open a support request at New support request - Microsoft Azure

If you have any ideas about how we can make WordPress on Azure App Service better, please post your ideas at Post idea · Community (azure.com)  You can report an issue in Github

or you could email us at wordpressonazure@microsoft.com to start a conversation.

 

 

 

 

 

 

Updated Feb 04, 2025
Version 14.0

16 Comments

  • Tony_Millar - Can you please share your subscription ID, opening a github issue or through support ticket so that we can troubleshoot your issue and help resolve it.  We are releasing a new version of plugin in couple of days which will give you detailed logging to help troubleshoot the issue.    Follow this link to setup the debug logs for your WP site: wordpress-linux-appservice/WordPress/enabling_debug_logs_for_wordpress.md at main · Azure/wordpress-linux-appservice (github.com)

  • Tony_Millar's avatar
    Tony_Millar
    Copper Contributor

    Good afternoon,

    We have recently set-up a fresh Word Press App Service on Azure and are trying to use the Azure Communication Service to send email, I have followed the instructions on this page, installed the plugin and activated it.

    I have also added the following to my app service configuration :

     

    When I initially installed it, everything seemed to work no problem, then the next day it has all stopped all of a sudden.

     

    I have checked my access key, sender address, endpoint etc. and all are spot on.

     

    I have been trying to look through log files to see what the error is but I can’t seem to find any.

     

    Also when I enable WP Debugging within the wp-config.php file I am not receiving any logs in the /wp-content folder.  

     

    Do you know where the logs would be on an Azure app service? Do you have logging for your plugin I could check?

     

    Do you have any suggestions I might be able to try?

     

    Thanks in advance

     

     

  • natelabo's avatar
    natelabo
    Copper Contributor

    I have attempted using the Marketplace Offering but no Communication Services resources (Email, Managed Domain, Etc.) are automatically configured. The only thing that I see happening is the plugin is installed and active?

     

    Update: I have followed the instructions to set up the components and it is working.

  • JHosemans - thank you for the feedback, added the app setting value and the format it has to be configured. 

  • JHosemans's avatar
    JHosemans
    Copper Contributor

    The Article is missing the syntax for the app setting in section 7. Also it could be a bit clear what you are adding and where.