Using hooks to customise email content
updated 12 months ago
Newsletter Glue offers 2 hooks that give you access to customize the content of email. They only work in the email context (so the regular post content will not be affected)
The hooks are:
The first parameter is the email content, much like the_content filter. Second parameter passed the $app (Which is current ESP - e.g. mailchimp, mailerlite) and Last parameter passed the $post object. Here is a very quick usage example.
That would insert very simple words, but ofcourse you can put any custom content there.
Important note: For email compatibility and ensuring that your custom content will be rendered correctly across various clients, please use tables markup to add custom content.
These hooks do not run in the blog post content (Only in email/email preview)
You can also target content for a specific ESP. By using conditional logic combined with $app to check if the email is processed to Mailchimp for example, and add specific content only if the ESP matches.