Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

sendEmail(String to, String subject, String message)

The sendEmail function The sendEmail function requires three string parameters: the recipient's email address, the subject of the email, and the message of the email. 

Code Block
sendEmail(String to, String subject, String message)

The email can be formatted via html HTML tags and can contain groovy Groovy variables. See example below:

Code Block
titleExample
def user = quote.createdByName

...


def u = api.find("U", Filter.equal("loginName", user))

...


def email = u.email[0]

...




def url = "https://qa.pricefx.eu/priceFxWeb.html?targetPage=priceShopPage&targetPageState=" + quote.typedId + ""

...


api.sendEmail(email, "Price F(x) Quote - " + customerName + " - " + vendorPart + "", "" + customerName + " ordered " + vendorPart + " at quantity of " + actualQuantity.toInteger() + ". This is below committed quantity of " + quotedQuantity + " with tolerance. " + "<br><br>" + "<a href=" + url + ">View Quote</a>")