Hi,
You can change the ‘Action to do’ in the automated action to ‘Execute Python Code’ instead of ‘Send Email’.
Then the give the following python code.
if record.x_studio_myfield == 'YES':
mail_template = env.ref('sale.email_template_edi_sale')
mail_template.send_mail(record.id, force_send=True)
You can provide the required email template’s XML ID inside env.ref(‘...’).
In order to find the XML ID of email templates you can enable developer mode , go to Settings > Technical > Email > Templates , select the required template , click on debug tool and click on ‘View Metadata’.
Another suggestion is that you can create a boolean field instead of the character field ‘x_studio_myfield’ and use the python code as:
if record.x_studio_my_boolean_field:
mail_template = env.ref('sale.email_template_edi_sale')
mail_template.send_mail(record.id, force_send=True)
Regards