Recepient undefined

i have done almost everything to get my email notifications on wix code… after finishing i tested to see if it will work but i did not get any notification. Sendgrid is also saying whats on the picture below… am not sure what to do or how to fix that “recipient undefined”…


done

You missing the recipient. you can or define const or add it as parameter to your routine but you need to define it somewhere.

1 Like

how do i even do that

Hi,

The recipient is the one who gets the mail :slight_smile:
So, somewhere in your code you’re calling the sendEmailWithRecipient function with subject and body
You’re missing the email address to send to.
Add a parameter like this:

sendEmailWithRecipient(subject, body, recipient) {
    //sending code is here
}

Then, when calling the function add the recipient address:

const subject = 'Subject goes here';
const body = 'Body goes here';
const recipient = 'example@gmail.com';
sendEmailWithRecipient(subject, body, recipient)

Liran.

1 Like

thanks Liran… so shall i copy this code and paste it on 17 or something

No… this is just a small example that help understanding the use of email sending.
You need to adjust the code so it will work for your needs.

Liran.

it’s the adjusting that am not sure about… am not sure how to do it…

Sorry,

But in order for us to help you, you’ll need to be more specific.
Try reading the code and this article carefully, try to understand the flow.
If you have specific issues, we’ll be happy to help.

Liran.