onTrialStarted Triggering Twice – Prevent Duplicate Welcome Emails #293
takkbbl
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
In my extension, I implemented a welcome email that gets triggered by
extpay.onTrialStarted.addListener()
. However, I ran into an issue where the welcome email was being sent twice for every new user.If you ever encounter the same problem, here’s a simple workaround:
extpay.onTrialStarted.addListener(user => { chrome.storage.local.get(["trialEmailSent"], (data) => { if (!data.trialEmailSent) { sendEmail(user.email); chrome.storage.local.set({ trialEmailSent: true }); } }); })
Hope that helps!
Cheers, Felix
Beta Was this translation helpful? Give feedback.
All reactions