Hello again @supportdelfino 🙂
For a variety of reasons, I don’t think we will ever add functionality to the plugin to send out emails. Email is a huge headache. That’s why we let MailChimp handle it!
However, you’re not the first person to ask for this and we do have a filter function you can use.
Try this code:
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 );
}
Let me know how that works for you.
Cheers,
Kevin.
P.S. I have the radio button required field issue fixed. We’ll probably release that at the end of this week or the beginning of next week.
Hi Kevin (again) 🙂
Yes it’s works!!!
Why this simple and great functions doesn’t like?! 🙁 😛
It’s great!
Thank you so much for all!
Hello, please tell me where the code should be inserted?
Hi @apedede,
Filter functions should go into your child theme’s functions.php file. If you’re not using a child theme, then you can either put it in your theme’s functions.php file or use a plugin like My Custom Functions.
Let me know if you have any more questions!
Cheers,
Kevin.
Thanks for the answer, I tried to include it in the theme, which with the prlugin My Custom Functions, unfortunately does not seem to work. My theme is Total. 🙁
Hi @apedede,
1. Do you know if your website is able to send emails?
2. Did you make sure to add your email address? (this line $admin_email = 'ENTER YOUR EMAIL HERE!'; // e.g. '[email protected]')
3. Do you have any mail logging set up? I’m wondering if the issue is with the email being sent or if the code is never called.
Let me know!
Thank you,
Kevin.
Hi Kevin,
1 Yes, it is able as with example contact form7 are sent,
2 yes, I entered my email.
…..
$admin_email =’Sorry’; // e.g. ‘[email protected]’
$subject = ‘New MailChimp Submission for Form: ‘ . $form_name;
$headers = array( ‘Content-Type: text/html; charset=UTF-8’ );
-
This reply was modified 8 years ago by
apedede.
Hi @apedede,
If that’s your real email, you might want to edit your response and remove it.
It’s okay! I’ve put my email on these boards multiple times and received a lot of spam ever since so I’m just trying to help!
Can you send me a URL to your form?
Thank you,
Kevin.
This post has been held for moderation by our automated system and will be manually reviewed by a moderator.
I can not send you url is blocked
I see that. I’m sorry. I’m not sure what’s going on there. If you’re using My Custom Functions, did you make sure the code was turned on? I think they have an active/inactive switch.