Skip to Content
0
Former Member
May 22, 2018 at 04:14 PM

Error while sending Mail with attachment through GROOVY

680 Views

Hi All,

I did below settings in local.properties for mail

 emailservice.send.enabled=true
 mail.smtp.server=smtp.googlemail.com
 mail.smtp.port=587
 mail.smtp.user=abc@gmail.com
 mail.smtp.password=abc
 mail.use.tls=true
 mail.smtp.debug=true
 mail.starttls.enable=true
 mail.smtp.auth=true
 mail.from=abc@gmail.com
 mail.replyto=abc@gmail.com   
 
 order.send.to.email.address=abc@gmail.com
 order.send.to.display.name=Failed Order
 order.from.email.address=abc@gmail.com
 order.from.display.name=Failed Details

Define constants in cgicoreconstants.java

 public static final String GLOBAL_CATALOG = "globalProductCatalog";
 public static final String STAGED = "Staged";

And created Groovy script to send mail with attatchment link text

But when I execute script I am getting error
Script execution has failed [reason: de.hybris.platform.servicelayer.exceptions.ModelSavingException: [de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator@5dadc933]:missing values for [catalogVersion] in model EmailAttachmentModel () to create a new EmailAttachment]

I return catalogVersion in groovy script and checked so its returning a catalogVersionmodel it means catalogVersion is not empty

Is their any thing missing or wrong?

Attachments