Custom Hooks
-
Hi, Eventualo.
How’re you doing?
I hope everything is fine.At the moment, I’m sending out two attachments for every newsletter subscriber using the function snippet below, inside the mu-plugin folder.
I was wondering how I could tweak it to send out either two attachments in Italian or two attachments in English, depending on the selection the subscriber makes for the newsletter language (Italian / English.)
If you could help me yourself, or direct me to some site that has some information.
PS.: When the email field is empty, your plugin gives the message:
“The e-email address is not correct”, but should be: “The e-mail address is not correct” e-mail, not e-email.Thanks!
Marco.
————————————– custom hooks function snippet
function custom_easymail_subscriber_activated ( $email ) {
// uncomment next lines to send a welcome message to just-activated subscribers
add_filter(‘wp_mail_content_type’,create_function(”, ‘return “text/html”; ‘));
$attachments = array();
$subscriber = alo_em_get_subscriber( $email );
$subject = “Welcome to the Newsletter!”;
$body = file_get_contents(WP_CONTENT_DIR . ‘/uploads/email_text.php’);
array_push($attachments, WP_CONTENT_DIR . ‘/profile-pics/attachment1.epub’ );
array_push($attachments, WP_CONTENT_DIR . ‘/profile-pics/attachment2.mobi’ );
wp_mail( $email, $subject, $body, false, $attachments);
}
——————————————————
The topic ‘Custom Hooks’ is closed to new replies.