Skip to content

Commit

Permalink
Merge pull request #84 from muhammadNassef/master
Browse files Browse the repository at this point in the history
fix: get template actual name instead of template document name
  • Loading branch information
shridarpatil authored Aug 19, 2024
2 parents 1711337 + 7b7c107 commit a46125d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ def send_scheduled_message(self) -> dict:
"WhatsApp Templates", self.template,
fieldname='language_code'
)
template_actual_name = frappe.db.get_value(
"WhatsApp Templates", self.template,
fieldname='actual_name'
)
if language_code:
for contact in self._contact_list:
data = {
"messaging_product": "whatsapp",
"to": self.format_number(contact),
"type": "template",
"template": {
"name": self.template,
"name": template_actual_name,
"language": {
"code": language_code
},
Expand Down Expand Up @@ -78,7 +82,7 @@ def send_template_message(self, doc: Document):
"to": self.format_number(doc_data[self.field_name]),
"type": "template",
"template": {
"name": self.template,
"name": template.actual_name,
"language": {
"code": template.language_code
},
Expand Down

0 comments on commit a46125d

Please sign in to comment.