CMDBuild Forum

Emails are sent without attachments

I can recieve custom emails from Task Manager>Send mail, and emails after an error in Task Manager>Import/Export file, but in both cases there is not attachment sent (in the first case, a working Jasper report, in the second case the cmdb error log)

There is some settings I have to configure in order to enable those attachments?
I had this problem in cmdb v3.3.2 and also on v3.4 as well

Screen case #1:
immagine

Screen case #2:
immagine

When I create a new “Send mail” job, this is the output of tomcat/logs/cmdbuild_ddl.log

INSERT INTO "_Job" ("Type", "Enabled", "Description", "Code", "Config") VALUES ('sendemail', FALSE, 'Report3', 'Report3', '{"email_template":"Report","email_account":"CMDB Users","attach_report_enabled":"false","attach_report_code":"TotaleNoleggi","attach_report_format":"pdf","cronExpression":"* * * * ?","attach_report":"true"}'::jsonb) RETURNING "Id";

UPDATE "_Job" SET "Type" = 'sendemail', "Enabled" = TRUE, "Description" = 'Report3', "Code" = 'Report3', "Config" = '{"attach_report":"true","email_account":"CMDB Users","cronExpression":"* * * * ?","email_template":"Report","attach_report_code":"TotaleNoleggi","attach_report_format":"pdf","attach_report_enabled":"false","_id":"CMDBuildUI.model.tasks.TaskSendEmailConfig-21"}'::jsonb WHERE "Id" = 6482821;

I don’t know why “attach_report_enabled” is set to “false”… “attach_report” is set to “true” though

Solution:

#create the sendmail job via CMDB di CMDB (Task Manager/Send Mail)

#connect to cmdb DB

sudo su postgres -c psql postgres
\c cmdb_database

#see the UPDATE command stored in tomcat/logs/cmdbuild_ddl.log and put it manually in cmdb Database, changing from false to true this action: “attach_report_enabled”=“true”

UPDATE "_Job" SET "Type" = 'sendemail', "Enabled" = FALSE, "Description" = 'Report5', "Config" = '{"attach_report":"true","email_account":"CMDB Users","cronExpression":"0 4 1 * ?","email_template":"Report","attach_report_code":"BEV","attach_report_format":"pdf","attach_report_enabled":"true"}'::jsonb, "Code" = 'Report5' WHERE "Id" = 6538702;