MozillaFoundation / donate-wagtail

[Legacy] - Wagtail based donation stack
Mozilla Public License 2.0
43 stars 22 forks source link

[High-Priority] Initial Email after recurring donation is showing as 'One-Time' #1466

Closed danielfmiranda closed 3 years ago

danielfmiranda commented 3 years ago

Describe the bug When a user makes a recurring donation, the 1st email they receive says "One-TIme" in the subject line and email body.

To Reproduce Steps to reproduce the behavior:

  1. Visit https://donate-wagtail.mofostaging.net/en-US/
  2. Click on the "Monthly" Radio Button
  3. Click on the purple visa button
  4. Fill out the form with test information of your choosing, please use an email you can recieve EX: +123@mozillafoundation.org
  5. Fill out credit card information with test credit card info below
  6. Submit the form
  7. Recieve thank you email, note the subject line says "One-Time" as well as the donation details in the body.

Test Credit Card Info Card Number: 4111 1111 1111 1111 Exp Date: 12/23 CVV: 123

Expected behavior The initial email after making a donation should say "Recurring"

danielfmiranda commented 3 years ago

Some findings after trying to find a solution:

danielfmiranda commented 3 years ago

Hi @benhohner!

After @KalobTaulien and I took a look at the code to see where the email sending is happening for the initial recurring donation, we were able to find email sending for one-time donations, and subscription charges after the initial recurring charge.

However in terms of the initial recurring donation, we were able to follow the workflow in the code up until we create a new subscription for the user, but beyond that there is no mention of email sending, even though the emaii receipt is still sent.

This leads us to believe that this logic may lie on the braintree side, and we wondering if you had/could get credentials that we could possibly use to explore possible solutions?

Thanks!

ghost commented 3 years ago

Receipt sending is through Acoustic Transact not Braintree

On Thu, May 27, 2021 at 12:39 AM Daniel Miranda @.***> wrote:

Hi @benhohner https://github.com/benhohner!

After @KalobTaulien https://github.com/KalobTaulien and I took a look at the code to see where the email sending is happening for the initial recurring donation, we were able to find email sending for one-time donations, and subscription charges after the initial recurring charge.

However in terms of the initial recurring donation, we were able to follow the workflow in the code up until we create a new subscription for the user, but beyond that there is no mention of email sending, even though the emaii receipt is still sent.

This leads us to believe that this logic may lie on the braintree side, and we wondering if you had/could get credentials that we could possibly use to explore possible solutions?

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mozilla/donate-wagtail/issues/1466#issuecomment-849313473, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARPW6JKTTYE4DMSAQ7N3WATTPXEHDANCNFSM45P52BAA .

danielfmiranda commented 3 years ago

Hi @jackielu-mozilla!

We are actually finding that when a user makes a recurring donation, we can see that the user is created a subscription, but beyond that, none of our email sending/acoustic functions or code is being run, yet a email is still sent to the user mentioning the (One-Time) donation.

However, we find that when we make some changes to the block of code that is subscribing the user, for example:


 result = gateway.subscription.create({

            'plan_id': get_plan_id(self.currency),

            'merchant_account_id': get_merchant_account_id_for_card(self.currency),

            'payment_method_token': payment_method.token,

            'price': 3333, ##### <- The change we made

            'first_billing_date': now().date(),

        })

We are finding that this change is reflected in the email.

This leads us to believe that there is something we may be missing outside of our code in between the new subscription and sending out the email we would like to explore.

If you have any questions, please let me know and I can give you a call to explain further, or I can ask @KalobTaulien to chime in as well. Thanks!

ghost commented 3 years ago

Thanks for the explanation. The first shift for receipts was moving to Basket/Acoustic Transact, back in February, but then there was a 2nd more recent shift for Donate to call the Transact API directly as part of this overall CRM rollout. If I recall properly that 2nd more recent shift involved referring to Basket code to move the functionality over, so I wonder if that might be an avenue to explore.

Tagging in @WillatMozFdn who had helped worked on 2nd thing, and cc:ing @stephaniemcv for visibility.

WillatMozFdn commented 3 years ago

@jackielu-mozilla unfortunately while I was pretty involved with the first shift back in February as we moved into Acoustic, I was not involved in the 2nd thing at all -- apologies if I miscommunicated this to you on Slack.

stephaniemcv commented 3 years ago

Adding @stephanielowry so she can verify seeing correct receipts

danielfmiranda commented 3 years ago

Hi @jackielu-mozilla, @stephaniemcv @benhohner,

I am happy to announce that this bug is fixed! I have tested out both single and recurring donations in the staging app, and can confirm they are sending the correct emails. If you would also like to test, please visit the staging app at https://donate-wagtail.mofostaging.net/en-US/

Thank you and please let me know if you have any questions!