This question has been flagged
1 Reply
6875 Views

my email templaes like this :

    <!-- Email template for holiday -->
    <record id="holidays_require_email" model="email.template">
        <field name="name">holiday require</field>
        <field name="model_id" ref="hr_holidays.model_hr_holidays"/>
        <field name="email_from">holiday@test.com</field>
        <field name="email_to">
            <![CDATA[
                % if len(object.employee_id.parent_id):
                  'codefans3@gmail.com '
                % endif
                % for p_id in object.employee_id.parent_id:
                ${p_id.work_email}  
                % endfor
            ]]>
            </field>
        <field name="subject">Holiday require</field>
        <field name="body_html"><![CDATA[

${object.user_id.partner_id.name} have a leave action, please login in opnerp to comfirm




${object.web_url}

]]></field> </record>

but this did not work.
the field parent_id is many2many

how can i do with this

thanks

Avatar
Discard
Best Answer

Hi

Of course you can send mail to many recipient

but you need to add , commas too

add emails after , commas

thanks
Sandeep

Avatar
Discard
Author

ok, thanks.

now i use a function field to store email.

if can i use this:

<field name="email_to"> <![CDATA[ % if len(object.employee_id.parent_id): 'codefans3@gmail.com ' % endif % for p_id in object.employee_id.parent_id: ${p_id.work_email}
% endfor ]]> </field>