WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. tilen
    Member
    Posted 2 years ago #

    Hello.

    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?

    http://wordpress.org/extend/plugins/alo-easymail/

  2. eventualo
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 2 years ago #

    @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

  4. eventualo
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 1 year ago #

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

  6. CleverClogs
    Member
    Posted 1 year ago #

    @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

  7. Drain0
    Member
    Posted 1 year 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

About this Topic