I am using:
emailService.sendEmail(email, caption, body, "text/html; charset=UTF-8",emailAttachment);
for sending some of emails from cuba. I´d like to create realation to SendingMessage entity after recod is created. Is there any way how cvan i acces record UUID or something after sending?
You can get these IDs, but you’ll need to change your code a bit.
Create your own service to send email.
Inject com.haulmont.cuba.core.app.EmailerAPI Spring bean to this service. This bean is not eligible for injection in global and web modules, only in core.
Use one of sendEmailAsync() methods - they return list of created SendingMessage entities.