i used this tutorial and have everything set up like this in wix & sendgrid.
here is the code from the game review page.
// For full API documentation, including code examples, visit https://wix.to/94BuAAs
// sendgrid doctorfitztastic@gmail.com dinosaur!
import {sendEmail, sendEmailWithRecipient} from 'backend/email';
$w.onReady(function () {
$w("#dataset1").onAfterSave(sendFormData);
});
function sendFormData() {
const subject = `Visitor Pinball Review for ${$w("#dropdown1").value}`;
const body = `Game Review:
\rName: ${$w("#input2").value}
\rEmail: ${$w("#input1").value}
\rPimball Game: ${$w("#dropdown1").value}
\r
\rAesthetics
\rAesthetic Rating: ${$w("#radioGroup1").value}
\rAesthetics Explanation: ${$w("#textBox1").value}
\r
\rDifficulty
\rDifficulty Rating: ${$w("#radioGroup2").value}
\rDifficulty Explanation: ${$w("#textBox2").value}
\r
\rGameplay
\rGameplay Rating: ${$w("#radioGroup3").value}
\rGameplay Explanation: ${$w("#textBox3").value}
\r
\rHistorical
\rHistorical Rating: ${$w("#radioGroup4").value}
\rHistorical Explanation: ${$w("#textBox4").value}
\r
\rOverall Review
\rReview: ${$w("#textBox5").value}`;
const recipient = $w("#input1").value;
sendEmailWithRecipient(subject, body, recipient)
.then(response => console.log(response));
sendEmail(subject, body)
.then(response => console.log(response));
}
in the email i am only receiving part of the form submission.
Game Review:
Name: Testing
Email: xxx@gmail.com
Pinball Game: AC/DC
Aesthetics
Aesthetic Rating: 8 – AWESOME
Aesthetics Explanation: This is a test to see if you recieve the entire email.
Difficulty
Difficulty Rating: 8 – THIS ROCKS
Difficulty Explanation: I am going to rate everything with an 8 for no reason.
Gameplay
Gameplay Rating: 8 – OVERLY COMPLICATED
Gameplay Explanation: It
I think it might be punctuation. quotes and commas in the body of the form that is cutting off the response. is there a way to fix this?
thanks. i tried several things. this one solved the issue. the
const carvedText = escape($w("#textBox1").value);
on the page code is the trick.
https://www.wix.com/corvid/forum/community-discussion/problem-with-and-in-form-inputs-in-sendgrid
thanks ill try str.replace some problematic punctuaton and see if that fixes the issue,
https://support.wix.com/en/article/corvid-tutorial-sending-an-email-on-form-submission
Important:
Using SendGrid to send emails from certain email providers may not work as expected. For example, see this notification about sending from Gmail addresses.
https://www.wix.com/corvid/forum/community-discussion/problem-with-and-in-form-inputs-in-sendgrid
https://www.wix.com/corvid/forum/community-discussion/help-ampersand-cutting-off-sendgrid-email
https://www.wix.com/corvid/forum/community-discussion/solved-sendgrid-conflicts-with-form-submission-email