Jump to content

Modify body of Ninja Forms email.


SarahB12

Recommended Posts

I'm attempting to modify the email message body based on a users input to a form. I'm using the code shown here as a starting point: https://stackoverflow.com/questions/40345116/manipulate-ninja-forms-mail-body?answertab=votes#tab-top Unfortunately even the most rudimentary change to the message body does not seem to work, and I'm unable to find any additional documentation on the ninja_forms_action_email_message filter. Has anyone attempted to modify the email message body upon submission?

 

Here's what I'd like to achieve. If the user submits "Yes" to a question, then I would add a list item to the body of the email I send them. If they answer "No", then no list item would be added.

 

Thanks so much!

~Sarah

Link to comment
Share on other sites

From the source code, it looks like the first passed parameter is the message and the second is an array of user-submitted form data. You should be able to check the second parameter for the status of your yes/no question, then update and return the message at that point. BTW - you'll find the filter definition in the includes/Actions/Email.php file.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.