Jump to content

Wrong cancellation email being sent out


Guest

Recommended Posts

image.thumb.png.f419e910218faee153e9dc4b8a2faf0f.png

Hi

We use the following cancellation email template. It works fine in English. When the user terminates a product with immediate effect, if prints "The service will be terminated within the next 24 hours". If a user chooses to terminate at the end of the current billing period, it prints "The service will be cancelled at the end o.....".

However, we have translated the email into Danish. No matter what, it always print the {else} clause in emails to our Danish customers. It always ignores the {=="Immediate"} clause when the user's language is set to Danish.

This means that no matter what cancellation option the user chooses, the email always reads "Servicen stopper ved slutningen af din betalingsperiode ...".
The product is correctly terminated - it is only the email wording that is incorrect.

What could be wrong? Input greatly appreciated.

EDIT: Ok update. Even if we copy-paste the English email into the Danish template, it still ignores the 'Immediate' and only prints {else} when user language is set to Danish. We cannot figure out why.

 

 

Edited by Guest
added more detailed info
Link to comment
Share on other sites

Ok the solution is that apparently our install of WHMCS requires us to also translate the "Immediate" variable into Danish, German, etc. although this should not be the case.

If we write {if $service_cancellation_type == "Øjeblikkeligt"} it works in Danish and {if $service_cancellation_type == "Sofort"} it works in German. I found a similar post on the internet with a Portuguese user with the exact same issue.

As far as I understand, it should not be necessary to translate the variable "Immediate". I should always be the same disregarding the language?

Link to comment
Share on other sites

3 hours ago, HenRex said:

Ok the solution is that apparently our install of WHMCS requires us to also translate the "Immediate" variable into Danish, German, etc. although this should not be the case.

If we write {if $service_cancellation_type == "Øjeblikkeligt"} it works in Danish and {if $service_cancellation_type == "Sofort"} it works in German. I found a similar post on the internet with a Portuguese user with the exact same issue.

As far as I understand, it should not be necessary to translate the variable "Immediate". I should always be the same disregarding the language?

Inmediate is not a variable here, it's text in the email. The variables that should never be touched are always in {$variable}, you should translate everything else in the email template.

I don't think the email template is using the form value "Inmediate" but the actual translated text. Therefore, it works when translated. Make sure that translation in your template matches the same word as in your template for each language.

Edited by yggdrasil
Link to comment
Share on other sites

I simply do not believe that is how solid programming should work.

{if $service_cancellation_type == "Immediate"} should read the option value, which remains constant with user language changes, and not the §LANG.clientarecancellationimmediate, which is variable depending on the set user language.

<option value="Immediate">{$LANG.clientareacancellationimmediate}</option>

 

Link to comment
Share on other sites

3 hours ago, HenRex said:

I simply do not believe that is how solid programming should work.

{if $service_cancellation_type == "Immediate"} should read the option value, which remains constant with user language changes, and not the §LANG.clientarecancellationimmediate, which is variable depending on the set user language.


<option value="Immediate">{$LANG.clientareacancellationimmediate}</option>

 

I agree but WHMCS and solid programming is not something that goes into the same sentence. WHMCS has so much legacy code around and the email template system is one of them. If you want to be meticulous, there are even hard coded language phrases in every release that are missing in the language files as well. They don't pay a lot of attention or care to the minute details in my experience.

Link to comment
Share on other sites

There must be some better way. I am not an expert in Smarty, so I don't know how to select the option value and not the label in this code:

<option value="Immediate">{$LANG.clientareacancellationimmediate}</option>

 

Do you think that this would work as a more general solution?

{if $service_cancellation_type == $LANG.clientareacancellationimmediate}

 

Or would something like this be allowed in Smarty?

{if $service_cancellation_type['Immediate'] == True}

 

Edited by Guest
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated