0

Email the contents of a record

Hoping I can get some direction.

I'd like to Print the contenct of record to a PDF and email it to the email address in the record.

I have the Print form created.  Now I need the script that will send the record data to the print form and email it.  

Thanks.

3 replies

null
    • MNA
    • 5 yrs ago
    • Reported - view

    Just about got it figured out.  First I print the record to an attachement.  Then I Send the email.  I'm missing some simple part of the code.

     

    importFile(this, printAndSaveRecord(this, "Weddings"), 'Bride, Last Name' + ".pdf")

    sendEmail({

    from: "my email.com",

    to: 'Email (Bride)',

    subject: "Hello World!",

    text: "Some text",

    attachments: file(this, 'Bride, Last Name' + ".pdf")

    })

     

    Getting an End Expected error.  See attached.

    Screen Shot 2018-12-31 at 2.53.15 PM 

    • blackie
    • 5 yrs ago
    • Reported - view

    I think you are missing    ;    at the end of the first line.

     

    importFile(this, printAndSaveRecord(this, "Weddings"), 'Bride, Last Name' + ".pdf");

    • MNA
    • 5 yrs ago
    • Reported - view

    Bingo.  Thanks.

Content aside

  • 5 yrs agoLast active
  • 3Replies
  • 1632Views