Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
7159 Weergaven

Dear all,

I want to add Whatsapp icon on website. When click on this icon Whatsapp will open. But I want to add a default  message on this link. This  message  will  be  in  a filed. 


class Website(models.Model):
_inherit = 'website'
 
whatsapp_mobile_number = fields.Char(string='Mobile Number') 

whatsapp_message_text = fields.Char(string='Whatsapp Message') 


How can i add whatsapp_message_text field value in the following code?


\https://api.whatsapp.com/send?phone=#{website.mobile_number}"
class="cy_whatsapp_web" target="_blank">

Best regards

Avatar
Annuleer
Beste antwoord

Hi,

You can pass the default message in the text variable along with the url in the same way how you passed the phone.

Sample:

https://api.whatsapp.com/send?phone="+self.mobile+"&text=" + message,


Also see this app:  https://apps.odoo.com/apps/modules/14.0/website_whatsapp_icon/


Thanks

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mei 24
3399
1
apr. 24
27230
1
nov. 22
2760
2
jul. 22
3506
2
jul. 22
3330