KarateSheets
KarateSheets
WWasp-lang
Created by KarateSheets on 9/13/2024 in #đŸ™‹questions
Custom Email with Loops
FYI to grab the email address from the passwordResetLink
const url = new URL(passwordResetLink);
const token = url.searchParams.get('token');
const { email } = JSON.parse(atob(token!.split('.')[1]));
const url = new URL(passwordResetLink);
const token = url.searchParams.get('token');
const { email } = JSON.parse(atob(token!.split('.')[1]));
21 replies
WWasp-lang
Created by KarateSheets on 9/13/2024 in #đŸ™‹questions
Custom Email with Loops
Looks like the email address is encoded in the token
21 replies
WWasp-lang
Created by KarateSheets on 9/13/2024 in #đŸ™‹questions
Custom Email with Loops
I suppose it would be possible to parse from the passwordRestLink, no?
21 replies
WWasp-lang
Created by KarateSheets on 9/13/2024 in #đŸ™‹questions
Custom Email with Loops
Setting the text field did resolve the error. Good call out! We do still need access to the user's email address in this situation, rather than hardcoding. Do you know any way around this?
21 replies
WWasp-lang
Created by KarateSheets on 9/13/2024 in #đŸ™‹questions
Custom Email with Loops
Unfortunately, it doesn't help. We need the ability to trigger Loops via the SDK to send the designed transactional email.
21 replies
WWasp-lang
Created by KarateSheets on 9/13/2024 in #đŸ™‹questions
Custom Email with Loops
Thanks for looking into this. Unfortunately, adding the stringified Loops object to the html key does not seem to work. I created this function in email.ts and replaced getPasswordResetEmailContent in main.wasp . Still getting a 450 error. Failed to send email Error: Message failed: 450 Unexpected end of JSON input The other issue this method presents is that I do not have access to the user's submitted email address in the forgot password form. To test I am hardcoding in the body. Is there a way to pass that address through if I'm able to get SMTP working? Loops will require this address to send the transactional email. export const smtpPasswordReset = ({ passwordResetLink }: {passwordResetLink: string}) => ({ subject: 'Password reset', text: Click the link below to reset your password: ${passwordResetLink}, html: JSON.stringify({ transactionalId: process.env.LOOPS_RESET_PASSWORD_TRANS_ID!, email: '[email protected]', dataVariables: { passwordResetLink, recipient: '[email protected]' } }), }); Any other suggestions? I'm not sold that SMTP will be the best way forward here. Thanks again for all of your help.
21 replies
WWasp-lang
Created by KarateSheets on 9/13/2024 in #đŸ™‹questions
Custom Email with Loops
You're the best. Thank you!
21 replies
WWasp-lang
Created by KarateSheets on 9/13/2024 in #đŸ™‹questions
Custom Email with Loops
@miho Hello, following up here. I'm sure you haven't had time to test implementing Loops but wanted to make sure this didn't get lost. Appreciate any help you can provide.
21 replies
WWasp-lang
Created by KarateSheets on 9/13/2024 in #đŸ™‹questions
Custom Email with Loops
Yes it is! It does require an account, of course.
21 replies
WWasp-lang
Created by KarateSheets on 2/13/2024 in #đŸ™‹questions
Cascade Deletes with transaction
Thank you! This is perfect :).
5 replies
WWasp-lang
Created by KarateSheets on 2/13/2024 in #đŸ™‹questions
Cascade Deletes with transaction
I should specify this is via the OpenSaas boilerplate.
5 replies