SarahB12 Posted December 27, 2017 Share Posted December 27, 2017 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 Quote Link to comment https://forums.phpfreaks.com/topic/306008-modify-body-of-ninja-forms-email/ Share on other sites More sharing options...
ginerjm Posted December 28, 2017 Share Posted December 28, 2017 Are you still seeking help? If so, this forum likes it when you post some code to look at. Not all of it mind you, but the parts that are important for the problem. 1 Quote Link to comment https://forums.phpfreaks.com/topic/306008-modify-body-of-ninja-forms-email/#findComment-1554964 Share on other sites More sharing options...
gizmola Posted December 29, 2017 Share Posted December 29, 2017 Yes, we need to see code. Obvious questions: -Do you have a token in the email template to replace with your ul or ol code? What does the form data look like when a user chooses yes? Is it a checkbox, dropdown, what? Quote Link to comment https://forums.phpfreaks.com/topic/306008-modify-body-of-ninja-forms-email/#findComment-1554974 Share on other sites More sharing options...
maxxd Posted December 30, 2017 Share Posted December 30, 2017 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. Quote Link to comment https://forums.phpfreaks.com/topic/306008-modify-body-of-ninja-forms-email/#findComment-1554986 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.