Multiple Submission Notification Emails
-
Hey I’ve used your filter function to send out email notifications to myself and it works great. I searched through the database to see if this has been answered and couldn’t find it.
I have multiple forms on my site and need to be notified when they’re filled out. Is there a way to use the filter function to set a different email subject line for each different form?
This is the filter function I’m referencing:
`add_action( ‘yikes-mailchimp-form-submission’, ‘yikes_send_email_after_submission’, 10, 4 );
function yikes_send_email_after_submission( $email, $merge_variables, $form_id, $notifications ) {
$interface = yikes_easy_mailchimp_extender_get_form_interface();
$form_data = $interface->get_form( $form_id );
$form_name = $form_data[‘form_name’];
$content = ‘<p>MailChimp Submission for Form: ‘ . $form_name . ‘</p>’;
$content .= ‘<p>A user with the email ‘ . $email . ‘ has attempted to subscribe to your MailChimp list.</p>’;
$content .= ‘<p>Here is their information: </p><br>’;
foreach ( $merge_variables as $merge_tag => $merge_value ) {
$content .= ‘<p>’ . $merge_tag . ‘: ‘ . $merge_value . ‘</p>’;
}
$admin_email = ‘ENTER YOUR EMAIL HERE!’; // e.g. ‘[email protected]’
$subject = ‘New MailChimp Submission for Form: ‘ . $form_name;
$headers = array( ‘Content-Type: text/html; charset=UTF-8′ );wp_mail( $admin_email, $subject, $content, $headers );
}’Thanks in advance!
Kyle
The page I need help with: [log in to see the link]
- The topic ‘Multiple Submission Notification Emails’ is closed to new replies.