Hi,
I have mail template whenever some state is change in module ..
but mail is containing is old state ..
and please tell me how to send attachment(print report(like sale order or purchase order)) with mail.Automatically create pdf report and send with mail..
Please tell me
how to resolve two problem.
<? xml version = "1.0" encoding = "utf-8"?>
<odoo>
<record id = "support_ticket_mail_template" model = "mail.template">
<field name = "name"> Support Ticket Update </field>
<field name = "model_id" ref = "my_module.model_support_ticket"> </field>
<field name = "email_from"> <! [CDATA [$ {object.company_id.name} <${object.company_id.emailteit>] ""> </field>
<field name = "email_to"> $ {object.email_from | safe} </field>
<field name = "subject"> Support Ticket (# $ {object.sequence or object.name}) </field>
<field name = "auto_delete" eval = "False" />
<field name = "built_in" eval = "True" />
<field name = "body_html"> <! [CDATA [
Hi
% if object.partner_id:
<p> Dear $ {object.partner_id.name}, </p>
% endif
% if object.stage_id.id! = 7:
<p> Your ticket has been updated, the status has changed to <b> "[$ {(object.stage_id.name)}]" </b>
<br/> Ticket state no: $ {(object.stage_id.id)}, $ {(object.stage_id)}, $ {object.stage_id.name}
If you want to get more detailed information, <b> View Ticket Online: </b> <a href="inside.unipiece.com.tw/my/ticket/"> here </a> <br/>
</p>
<p> Best Regards <br/>
UniPiece Support System Bot
</p>
% endif
% if object.stage_id.id == 7:
<p>
Your ticket has been closed, we've attached the detail information as the attached file.
For providing better customer experience, please help rate our service this time below:
<br/> Ticket state no: $ {object.stage_id.id}, $ {object.stage_id}, $ {object.stage_id.name}
If you want to get more detailed information, please click
<a href="inside.unipiece.com.tw/my/ticket/"> here </a>
</p>
<p> Best Regards <br/>
UniPiece Support System Bot
</p>
% endif
]]>
</field>
</record>
</odoo>
Sending mail on some event: https://goo.gl/z16PBZ