Send HTML email
Info
| Name | Value |
|---|---|
| Object ID | wunderautomation.html-email |
| Group |
Description
Sends an HTML email
Sends an HTML email using the WordPress wp_mail() function. The look and feel of the email can be controlled via file templates and using the style field.
Note that there are a lot of plugins that will override wp_mail() and send the email via services like Sendgrid, Postmark, etc. Some of these plugins may modify the generated HTML before it's sent out,
Fields
| Field | Type | Description |
|---|---|---|
| To | Text | The recipient of the email. Send to multiple recipient email address by separating each address with a comma. |
| To (role) | Multi select | Alternative to the standard To field. Specifies one or more WordPress roles (i.e. Administrators) that recieves the email. |
| Cc | Text | Optional. The Cc-recipent(s) of the email. Send to multiple recipient email address by separating each address with a comma. |
| Cc (role) | Multi select | Alternative to the standard Cc field. See Specifies one or more WordPress roles (i.e. Administrators) that recieves the email. |
| Bcc | Text | Optional. The Bcc-recipent(s) of the email. Send to multiple recipient email address by separating each address with a comma. |
| Bcc (role) | Multi select | Alternative to the standard Bcc field. See Specifies one or more WordPress roles (i.e. Administrators) that recieves the email. |
| From | Text | Optional, Speficies a custom From-address. Leave blank to use the WordPress default sender. See Custom from address. |
| Reply to | Text | Optional. Speficies a custom Reply-to address. |
| Subject | Text | The email subject line. |
| Header | Text | Optional, only availble for HTML and WooCommerce emails. Most WooCommerce email templates allows the user to specify a heading. Also, the standard HTML email template in WunderAutomation uses a template. |
| Style | Text | Optional, only available for HTML emails. Additional CSS rules that will be added to the style section of the rendered HTML email. |
| Content | Text | The email body. |
Templates
The standard Send HTML email action relies on overridable templates for the basic design. The standard HTML email action also allows you to skip using templates if you prefer to compose your HTML email entirely in the editor.
The original templates are located in: wp-content/plugins/wunderautomation/templates and consist of three files:
| Template file | Description |
|---|---|
| emails/email-styles.php | CSS rules. |
| emails/email-header.php | Start of the HTML at least up until and including the opening body tag |
| emails/email-footer.php | Renders the end of the HTML email. Must close all tags opened in the header. |
These templates can be overridden by copying them into the subfolder wunderautomation/emails in your theme.
When WunderAutomation renders an HTML email, it will first look for the file in the wunderautomation/emails subfolder of your theme and fall back to using the template provided with WunderAutomation.
Modifying default template colors
If you're using the built-in email templates, the color scheme can be modified via WordPress filters. The following filters are used:
| Filter | Default | Description |
|---|---|---|
| wunderautomation_email_background_color | #f1f1f1 | Background outside email body. |
| wunderautomation_email_body_background_color | #ffffff | Main body background. |
| wunderautomation_email_base_color | #0073aa | Base color for heading background. |
| wunderautomation_email_base_text | #ffffff | Text color for heading. |
| wunderautomation_email_text | #040404 | Default text color. |
| wunderautomation_email_link_color | #0073aa | Default link color. |
| wunderautomation_email_bg_darker_10 | #f0f0f0 | Darker version for background, for border color. |
| wunderautomation_email_body_darker_10 | #aaaaaa | Darker version for body background, for border color. |
| wunderautomation_email_base_lighter_20 | #2277a0 | Text shadow for H1 tags. |
| wunderautomation_email_base_lighter_40 | #4c93b5 | Not used. |
| wunderautomation_email_text_lighter_20 | #525252 | Lighter text, used in table details. |
| wunderautomation_email_text_lighter_40 | #949494 | Lighter text, used in footer. |
Skipping the template
It’s possible to send HTML emails without using any templates. Check the "Skip templates" checkbox to make WunderAutomation render the emails without templates. When sending emails without a template, the content field needs to contain all the needed HTML.
In order for the emails to render properly in some email clients you might need to include a full HTML structure with the style tag inserted in the head tag. To make this easier, WunderAutomation offers a special placeholder [WASTYLE] that copies the content of the Style field into the placeholder:
