ALO EasyMail Newsletter
Autoresponder with attachment on subscribing? (7 posts)

  1. tilen
    Posted 4 years ago #


    Does this plugin allow somehow to tweak itself so that a user, upon subscribing to newsletter, gets automatic feedback message with attached .pdf file for instance?


  2. eventualo
    Plugin Author

    Posted 4 years ago #

    Here you a sample function using the plugin hook. I've not tested it but it should work, let us know about it.

    function custom_easymail_welcome_mail ( $subscriber, $user_id ) {
    	$content = "Hi ". $subscriber->name . ", here you are a pdf";
    	$attachments = array(WP_CONTENT_DIR . '/uploads/file_to_attach.pdf');
    	wp_mail( $subscriber->email, "Welcome", $content, false, $attachments );
    add_action('alo_easymail_new_subscriber_added',  'custom_easymail_welcome_mail', 10, 2 );

    Here more info about WP mail function samples: http://codex.wordpress.org/Function_Reference/wp_mail

  3. Ar1978
    Posted 4 years ago #


    Hi I have the same issue. I would like to have a form in which people fill in their e-mail address. When they send it to me, a direct autoresponse should send a mail with a .pdf-file.

    I did see your code, but where should I place it, or in which plugin?



  4. eventualo
    Plugin Author

    Posted 4 years ago #

    Hi, you can paste the code inside the functions.php file in your theme folder, or inside EasyMail custom hooks file.

  5. Rendia
    Posted 4 years ago #

    Great solution! Is there a posibility to send this mail in html format?

  6. CleverClogs
    Posted 4 years ago #


    i integrate the code into the existing function

    function custom_easymail_subscriber_activated ( $email ) {
    	// uncomment next lines to send a welcome message to just-activated subscribers
    	$subscriber = alo_em_get_subscriber( $email );
    	$subject = "Willkommen in der Welt der Betriebsausgaben";
    	$content = "Hallo ". stripslashes( $subscriber->name ) .",\r\n\ndanke das Sie sich die Zeit genommen haben unseren Newsletter zu bestellen. Wir freuen uns Sie im Verteiler begrüßen zu können.\r\n\nAls kleines Dankeschön für Ihre Anmeldung erhalten Sie unser gratis E-Book zum Downloaden:\n\nhttp://www.betriebsausgabe.de/download/ebook-bdst.pdf";
    	$content .= " \r\n\nHinweis: Wir senden den Newsletter nicht regelmäßig, nur wenn es in der Buchführung etwas Neues zu berichten gibt, denn wir möchten Sie ja nicht gleich verärgern.\r\n\r\nLiebe Grüße aus Dingelstädt sendet\r\nTorsten Montag vom\r\n\r\n". wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    	$attachments = array(WP_CONTENT_DIR . '/uploads/0201/ebook-bdst.pdf');
    	wp_mail( $email, $subject, $content, false, $attachments );
    add_action ( 'alo_easymail_subscriber_activated',  'custom_easymail_subscriber_activated' );

    it doesnt work.

    what's going wrong?

    thank you

  7. Drain0
    Posted 3 years ago #

    Is it possible to send an newsletter with a pdf attached?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • ALO EasyMail Newsletter
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic