Prevent Welcome Email being sent by Product ID?

Discussion in 'Customization & add-ons' started by simple1001, Mar 4, 2013.

  1. simple1001

    simple1001 New Member

    Joined:
    Aug 15, 2010
    Messages:
    2
    Hi all,

    I have two separate membership sites, offering different services - both have their own aMember installations. Site A offers services, and users can publicly sign up. Site B also offers public signup, but also uses services offered by Site A. When users sign up to Site B, it implements the aMember API to automatically register and subscribe the user to a custom product in Site A. However, users are receiving the welcome email from Site A, which is causing confusion for them, and also the last stage hindering a seamless integration between the two sites.

    So, my question is, is there any way to natively prevent emails being sent to new users based on Product ID (Site A has a specific Product ID for Site B users), or any way that I can customise the code to implement this? I.e. When a user signs up to Site B, is there a way to prevent Site A also sending the superfluous welcome email?

    I'd be very grateful for any pointers in the right direction.

    Thank you kindly.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    How do you add users to Site A when user signup to Site B exactly?
  3. simple1001

    simple1001 New Member

    Joined:
    Aug 15, 2010
    Messages:
    2
    Hi,

    Sorry, I should have mentioned - I have written a plugin for Site B which uses Site A's aMember REST API to send signup and invoice creation requests using cURL. For example, when a user signs up to Site B, the onSignupUserAdded event in the plugin kicks of an apiAction=users POST request to add the user to Site A.

    Thanks
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Well I'm afraid there is no each way to do this.
    You may need to edit actual method which send signup message:
    User::sendSignupEmailIfNecessary(InvoicePayment $p = null)

    You can get invoice information from InvoicePayment object which is passed to this function.

Share This Page