• Hi Roland, we have two ways of a new user being added to the database. Either:

    a) a user applies
    b) an admin enters the new user

    For situation a), I want the email notifications to fire (working fine) but I don’t want to fire email notifications for situation b) which of course they currently do.

    I’m already utilizing the pdb-before_submit_signup filter to then make changes to the WP user Database. Is there a way to intercept the email action to prevent the mails being sent for situation b) ?

    Reg
    Greg

    https://ww.wp.xz.cn/plugins/participants-database/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Roland Barker

    (@xnau)

    Emails are not normally sent for new users added in the admin, so I’m wondering what’s going on. Are you sure that adding a new record in the admin generates an email?

    I have no filter in the plugin available to use to control email going out, but you can use the WordPress filter ‘wp_mail’ to control your outgoing emails.

    Thread Starter gld

    (@gld)

    Sorry Roland, I should have been more specific. The ‘admins’ are users with extra rights but are not using the Admin form. I have another page which uses a customized signup form to add these users. From the plugin perspective, I’m assuming these events are being seen exactly the same for both situations?

    Plugin Author Roland Barker

    (@xnau)

    OK, well make sure that signup form is properly configured: the emails are sent when the confirmation page is shown, are your admins seeing a confirmation message after adding a new record?

    Thread Starter gld

    (@gld)

    Yes it does that as well. I guess I need to intercept it before it goes to the confirmation form? I do need a different confirmation message for the admins.

    Plugin Author Roland Barker

    (@xnau)

    You can set the page the user will be sent to in the signup shortcode using the “action” attribute. That page will need to have the [pdb_signup_thanks] shortcode in order for the submission to be completed. If you want to customize that message (the plugin only has one confirmation message setting) you need to use a custom template for the signup thanks shortcode.

    The only way to intercept the outgoing email is to use the ‘wp_mail’ filter provided by WordPress. In your filter callback. you would inspect the outgoing message (or just check which page the user is on) and abort it if it is coming from your “admin” form submission.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Signup e-mail hook’ is closed to new replies.