WordPress.org

Support

Support » Plugins and Hacks » [Plugin: ALO EasyMail Newsletter] Autoresponder with attachment on subscribing?

[Plugin: ALO EasyMail Newsletter] Autoresponder with attachment on subscribing?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author eventualo

    @eventualo

    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

    @eventualo

    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?

    Regards,

    Arjan

    Plugin Author eventualo

    @eventualo

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

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

    @eventualo

    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

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: ALO EasyMail Newsletter] Autoresponder with attachment on subscribing?’ is closed to new replies.