Skip to main content
Inspiring
November 20, 2023
解決済み

JavaScript Email alignment

  • November 20, 2023
  • 返信数 2.
  • 1167 ビュー

I am working with a PDF form that has a submit button that emails the form and basic information. The javascript I am using works great, however, the alignment is off on the body of the email. When the button is pressed the email window comes up with:

Subject: Jobber Contact, Customer

New Warranty

Please enter and prepare to ship

Jobber Contact

Customer

When I enter data in the respective text boxes the email comes up with this (I've color-coded the lines that should be on the same line):

New Warranty

Please enter and prepare to ship

Jobber Contact

Customer

Product Repair Shop

Joe Blow

7015100

So how would I update my script to have the lines match?

 

var targetEmail = "me@email.com";

var subjectLine = this.getField("Jobber Contact").valueAsString + "  " this.getField("Customer").valueAsString;

var body = "New Warranty \nPlease enter and prepare to ship\nJobber Contact\nCustomer\nProduct " + this.getField("Jobber Contact").valueAsString + " " + "\n" + this.getField("Customer").valueAsString + " " + "\n" + this.getField("Product").valueAsString

this.mailDoc({cTo: targetEmail, cSubject: subjectLine, cMsg: body});

 

 

このトピックへの返信は締め切られました。
解決に役立った回答 Bernd Alheit

E.g. put

this.getField("Customer").valueAsString

between Customer and Product.

返信数 2

Bernd Alheit
Community Expert
Bernd AlheitCommunity Expert解決!
Community Expert
November 21, 2023

E.g. put

this.getField("Customer").valueAsString

between Customer and Product.

Bernd Alheit
Community Expert
Community Expert
November 21, 2023

You must change the string for body.

glazed01作成者
Inspiring
November 21, 2023

Thank you, can you elaborate?