• Resolved nonprofitweb

    (@nonprofitweb)


    Thank you for your plugin. I am trying to understand your send email functionality because I need to send different emails based on if the user has been updated or is a new user, so I can’t use your template option (both types of updates may happen during an import, which is one feature your plugin provides that others don’t!). If the option “Activate WordPress Automatic Email…” is selected, my custom new user email is sent. I am using the wp_new_user_notification_email filter to customize the new user email.

    If “Deactivate WordPress Automatic Email…” is selected, no email is sent. Obviously, the “Activate WordPress Automatic Email…” is applying a send email filter. When I dive into the code, I see the send_email_change_email filter, and when I try to use this hook to modify the email, the email content is still the content of the new user notification email.

    Of course I can modify the new user notification to function how I need but I’m afraid this behavior may be a bug and may change in future versions.

    Can you please enlighten me on the best way to customize my email message?

    Thank you.

Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Author Javier Carazo

    (@carazo)

    @ian23,

    No, there is no option to resend emails.

    So the best options would be to reimport them again, sending the email then.

    Hi Javier,

    I also need to send different emails to newly created users and to updated existing users.

    I saw the filters you developed for @nonprofitweb:

    $email_to = apply_filters( ‘acui_import_email_to’, $email, $headers, $data, $created );
    $subject = apply_filters( ‘acui_import_email_subject’, $subject, $headers, $data, $created );
    $body = apply_filters( ‘acui_import_email_body’, $body, $headers, $data, $created );
    $headers_mail = apply_filters( ‘acui_import_email_headers’, array( ‘Content-Type: text/html; charset=UTF-8’ ), $headers, $data );
    $attachments = apply_filters( ‘acui_import_email_attachments’, $attachments, $headers, $data, $created );

    ———————————————–

    I also saw the hook that @nonprofitweb provided to @lightwavin:

    function custom_csv_import_subject($subject, $headers, $data, $created){
    if ($created) { //check if $created is true
    $subject = ‘New Applicants’;
    }
    else $subject = ‘New Member Information’;
    return $subject;
    }
    add_filter( ‘acui_import_email_subject’, ‘custom_csv_import_subject’, 10, 4 );

    ————————————————

    I tried adding each of these code segments to our code snippets plugin one at a time. What I don’t understand is how either of these filters/hooks are triggered.

    For the code segment provided by @nonprofitweb, it looked like the hook would check to see if a user being imported was being created or was being updated. So, I created two email templates with subjects to match the $subject string in his code:

    Template 1 Subject: New Applicants
    Template 2 Subject: New Member Information

    But, this didn’t work.

    We’d like to be able to choose the email that is sent from a frontend import as a parameter to the shortcode, like this:

    [import-users-from-csv-with-meta role=”subscriber” email=”Applicant Information”]
    or
    [import-users-from-csv-with-meta role=”subscriber” email=”New Member Information”]

    Is this possible? If not, how is either of the filters/hooks above triggered to send one email template when a user account is created and the other email when the user account is updated?

    Your help would be most appreciated.
    Thank you!

    • This reply was modified 4 years, 5 months ago by crgccommsec.
    • This reply was modified 4 years, 5 months ago by t-p.
    Plugin Author Javier Carazo

    (@carazo)

    Good morning,

    Is this possible? If not, how is either of the filters/hooks above triggered to send one email template when a user account is created and the other email when the user account is updated?

    As you can see in the hooks this is not possible. Those data is not related and the shortocode does not accept more parameters.

    If you want, prepare this new functionality and we will include in the plugin.

    We will include more hooks in the future and this will be possible to do in a future then.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Send Email Action’ is closed to new replies.