Thank you in advance.
신고된 질문입니다
2
답글
543
화면
Good morning
I'm looking to automate a welcome message for every customer who contacts me via WhatsApp. For example: "Thank you for contacting us, we'll get back to you shortly." Is there a way to do this?
Hi,
Automate the Welcome Message
Once the template is approved, you can trigger it automatically using Odoo
Automations:
1. Go to Settings → Technical → Automation → Automated Actions
2. Click New:
- Model: WhatsApp Message or the relevant model
- Trigger: When a record is created
- Action: Send WhatsApp Message → select your approved template
Hope it helps
Hello Joaquin Inamine,
I hope you are doing well
- Set up an Automated Action: Model Discuss Channel, Trigger On Creation, Filter [("channel_type","=","whatsapp")], Action Execute Python Code:
WELCOME_TEXT = "Thank you for contacting us, we'll get back to you shortly."
if record.channel_type == 'whatsapp':
already = env['mail.message'].search_count([('model', '=', 'discuss.channel')('res_id', '=', record.id), ('author_id', '=', env.user.partner_id.id)])
if not already:
record.message_post(body=WELCOME_TEXT, message_type='whatsapp_message', subtype_xmlid='mail.mt_comment')
I hope this information helps you
Thanks & Regards,
Kunjan Patel
Hi Kunkan Patel
I followed all the steps in your explanation, but when I try to save, I get the error "IndentationError: unexpected indent at line 2 if record.channel_type == 'whatsapp':"
What could be the problem?
| 관련 게시물 | 답글 | 화면 | 활동 | |
|---|---|---|---|---|
|
|
3
6월 26
|
533 | ||
|
|
1
5월 26
|
454 | ||
|
|
2
2월 26
|
1723 | ||
|
|
4
2월 26
|
8884 | ||
|
|
0
10월 25
|
1807 |
Hello Joaquin Inamine,
I have updated answer now you can try that.
hope it helps