Source: site.view [edit]
Function name: mail
Arguments: name,email,subject,message
Description:
Page type: webl
Render function:  
Module: wwcs

Page source:

var subj = "WILD WEST GAMBLING SHOW FORM SUBMISSION";
var body = "<b>Name</b>: " + name + "<br>\n";
body = body + "<b>Email</b>: " + email + "<br>\n";
body = body + "<b>Subject</b>: " + subject + "<br>\n";
body = body + "<hr><br>\n";
body = body + message;


var APIKeyEnc = "U0cuQ2o4MVNMQlBUbGE4Sjh0Njl5Tmxtdy5halEyazRwSnhSQjFNVEFJUTViQmNyaW9HUlZDMExja3ptb29jUUh1WVJr";
var A = "Bearer " + Base64_Decode(APIKeyEnc);

var P = PostURL("https://api.sendgrid.com/api/mail.send.json", 
  [.  to="wildwestgamblingshow@gmail.com",
      from="donotreply@wildwestgamblingshow.com",
      subject=subj,
      html=body .],
  [. "Authorization" = A .]);


var redirect = `<head><meta http-equiv="refresh" content="0; URL='https://www.wildwestgamblingshow.com'" /></head><body><h2>Your message has been sent!<h2></body>`;
NewPage(redirect, "text/html");