How to create a custom email header?

By: Robert Taylor | Asked: 07/02/2024
ForumsCategory: Code HelpHow to create a custom email header?
Robert Taylor asked 3 weeks ago

I am using email notifications in my forms and I would like to add a custom email header in my formidable email notifications.  I created a new template in Wordpress and can insert the templates anywhere using shortcodes such as: [elementor-template id="14975"] I have read this page on the "frm_email_header" formidable hook and read this page on how to use the hook:  I have also read the docs on using the WPCode plugin for creating and using code snippets.  So far so good. Now to the issue: I am not a php programmer and the example in the docs suggest that I should be able to just use this to insert a header:

add_filter('frm_email_header', 'custom_header', 10, 2);
function custom_header($header, $atts)

However, this doesn't work and re-reading the docs suggests that I need to complete the php function and the above bit of code should look something like this:

add_filter('frm_email_header', 'custom_header', 10, 2);
function custom_header($header, $atts){ ... ? ... }

I have not been able to google or find an example code snippet that would allow for a simple "user this template shortcode as an email header for every email notification".  Can someone point me to what I need to know / read or has an example of something similar that I might be able to modify? And, yeah, I guess it's time that I learn some php.

1 Answers
Robert Taylor answered 3 weeks ago

Okay, I learned a bunch of php to describe my issue:

1) Posting this because I cannot delete this post for some reason.

2) I learned a bunch of php and this has nothing to do with what my goal. 

a) I needed to insert a <div></div> at the top of my email to "design a header at the top of the email".

b) The frm_email_header is something completely different, it allows the user to modify the header of an email and control header data such as to, from, bcc and other email header data. Apologies for the noise. 

If an admin can delete this email that might be the best option for this thread.  If this cannot be deleted hopefully this note helps other noobs parse what is going on.


Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community