Skip to main content
Inspiring
September 16, 2020
Resuelto

Adding Subject Line text to Javascript code

  • September 16, 2020
  • 6 respuestas
  • 1118 visualizaciones

Hi,

I have been using the below code, which I found on this community, to alert required fields which works fine when all is good and the email pops up it is missing the subject line, can anyone help with the Javascript to add text to the Subject Field

 

Thanks in advance

Paul

 

var emptyFields = []; for (var i=0; i<this.numFields; i++) { var f= this.getField(this.getNthFieldName(i)); if (f.type!="button" && f.required ) { if (f.defaultValue==f.valueAsString) emptyFields.push(f.name); } } if (emptyFields.length>0) { app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n")); } else this.mailDoc({cTo: "Colette.Williams@sjp.co.uk"});

Este tema ha sido cerrado para respuestas.
Mejor respuesta de try67

Change this:

{cTo: "Colette.Williams@sjp.co.uk"}

To:

{cTo: "Colette.Williams@sjp.co.uk", cSubject: "Message subject goes here"}

6 respuestas

try67
Community Expert
try67Community ExpertRespuesta
Community Expert
September 16, 2020

Change this:

{cTo: "Colette.Williams@sjp.co.uk"}

To:

{cTo: "Colette.Williams@sjp.co.uk", cSubject: "Message subject goes here"}

Inspiring
September 16, 2020

Thats Brilliant much appreciated as always