Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: get template actual name instead of template document name #84

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

muhammadNassef
Copy link
Contributor

While sending messages using notification
it shows this error message: "(#132001) Template name does not exist in the translation"

@shridarpatil
Copy link
Owner

@muhammadNassef can you explain steps to reproduce this issue?

@muhammadNassef
Copy link
Contributor Author

@shridarpatil Ok, here are the steps
1- Define new WhatsApp Notification:
* set Notification Type to Doctype Event
* set Reference Document Type e.g. "Customer"
* define Field Name e.g. "Customer Phone Number"
* define DocType Event e.g. "After Save"
* define Template
2- from Customer Doctype try to edit and save, and you will get a notification error, the error will also be recorded in the WhatsApp Notification Log

@@ -35,14 +35,18 @@ def send_scheduled_message(self) -> dict:
"WhatsApp Templates", self.template,
fieldname='language_code'
)
template_actual_name = frappe.db.get_value(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of making a database call. We can save name field in whatsapp template as self.template_name.lower().replace(" ", "_")

@shridarpatil
Copy link
Owner

added a fix for this

@shridarpatil shridarpatil reopened this Aug 19, 2024
@shridarpatil shridarpatil merged commit a46125d into shridarpatil:master Aug 19, 2024
1 check passed
@shridarpatil
Copy link
Owner

We need this to add support for Multilingual templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants