This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 12 replies, has 2 voices.

Last updated by Bruno Kos 2 months, 3 weeks ago.

Assigned support staff: Bruno Kos.

Author Posts
July 18, 2019 at 7:23 am

sebastienR-13

Our client uses the Translation Management page to create new jobs (usually with a single post to translate) and assigns it to a single translator and everything is done internally.
For the past 5 years everything has worked has expected, only the translator assigned to the job received an email stating he had a new job to do.

Right now, every translator receives the global "A new job has been created" (which is supposed to be sent only when a job is not assigned to a specific translator AFAIK) on top of the assigned translator's email.

I've tried to update WPML with no luck, and I cannot reproduce this on our staging version or on my localhost.

As of now, I disabled the option "Notify me when there is a new translation job available" (or something like this) on each of the translators' profile. I guess it should only disable the global email and not when a job is assigned?

Is there a way (filter, hook?) to disable the global email permanently? Our client doesn't need it anyways and it would prevent a great deal of stress because it currently creates a lot of confusion, double translations and therefor double invoicing...

Thanks in advance

July 18, 2019 at 9:27 am #4236713

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

Can you try going to WPML->Settings->Translation Notifications tab where you should be able to control the notifications? Does it help?

Regards,
Bruno Kos

July 18, 2019 at 9:35 am #4236869

sebastienR-13

Hi,

Thank you for answering.

What is the difference between the "Notify translators when new jobs are waiting for them" option and the option available on a translator's profile?

Note that we still need the notification sent to the assigned translator, but not the global "A new job is waiting a translator".

It looks like what I want to disable might be located on line 33 of the file class-wpml-tm-batch-report-email-process.php where the 'prepare_unassigned_jobs_emails' method is called.
On top of simply disabling it, which will only work as long as I do not update the plugin, is there a way of knowing why a job isn't considered assigned to a translator even though it is in the admin when submitting the form? Where would the data be located in the database?

July 18, 2019 at 10:34 am #4237493

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

What is the difference between the "Notify translators when new jobs are waiting for them" option and the option available on a translator's profile?

I think that one is a global option, so for all the translators, while other is per translator.

is there a way of knowing why a job isn't considered assigned to a translator even though it is in the admin when submitting the form?

I am not sure, but is this your question? See the image. When creating new translation jobs, you can assign directly to specific translators.

As for disabling this, I found couple of older threads, so not sure if the code is still valid or in the same position:
https://wpml.org/forums/topic/disable-sending-translation-job-mail/#post-813520
https://wpml.org/forums/topic/new-translation-job-emails-keep-sending/page/2/#post-834564

Regards,
Bruno Kos

July 18, 2019 at 11:03 am #4237873

sebastienR-13

My issue is:

Even when assigning a job to a specific translator (which is done 100% of the time, the logic here hasn't changed in 5 years and since it is done internally there is no point in not choosing a translator) all other translators receive the "New job waiting for a translator" email.
They shouldn't receive it (and didn't in the past) but for the past 2-3 months this issue has appeared and I cannot reproduce it on my own machine or on our staging environment.

Since a job will always be assigned to a translator, can't I simply disable the specific email sent for unassigned jobs? If so, how can I do it in a way so that upgrades do not override my fix?

Thanks

July 18, 2019 at 12:43 pm #4238719

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

They shouldn't receive it (and didn't in the past) but for the past 2-3 months this issue has appeared and I cannot reproduce it on my own machine or on our staging environment.

How about we try to reproduce this issue on our clean sandbox installation, simply to exclude that the bug is there?

Login: hidden link
Username: demo
Password: 3JsfOL5f2uO8

I have already set everything up and installed Email Log plugin which will record all the emails that are sent (not for real, offcourse). I added few translators.

Can you try checking various scenarios by creating translation jobs in the same way you do, while also checking and unchecking various options for disabling these emails (either on WPML settings page or personal translator profiles)?

Regards,
Bruno Kos

July 18, 2019 at 1:50 pm #4239325

sebastienR-13

Hi Bruno,

As expected the issue isn't there on your sandbox, just like on my own machine or our staging environment which makes debugging much harder.

Since I do not have the luxury to try and debug it first hand on our production server (because translators will get emails and might charge for an unwanted translation) my idea was to kill that email directly inside the plugin (it isn't used, ever)...

July 18, 2019 at 2:14 pm #4239545

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Can you tell me the following:

just like on my own machine or our staging environment which makes debugging much harder.

Is the staging environment an exact clone of the production site, or are there any differences? When mentioning that the issue has been happening for the last few months, did you install some plugins in between?

For example, I see this one:
- Emails Catch All

Maybe it is interfering with how WPML handles them?

Also, I see that on the production site, you have WPML 4.2.5 which is not latest version. You can see all the latest versions of the plug-ins here:
https://wpml.org/account/downloads/

Can you try updating?

Maybe that's the difference between my sandbox, your staging site and the production one?

Regards,
Bruno Kos

July 18, 2019 at 2:56 pm #4239865

sebastienR-13

Hi,

There must be a difference, but when I did my tests I duplicated the entire production database to the staging environment and deployed the same branch from git. There shouldn't be any difference in theory...

I've tried with Emails Catch All enabled, disabled or completely removed without any success.

I've also tried updating WPML various times since the bug was first brought up by my client without any changes (though it fixed some other unrelated things).

I will try to go deeper next week, hopefully I can get a clearer answer as to why a job is considered unassigned when the email is sent.

Thanks

July 19, 2019 at 5:25 am #4244045

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Right now, every translator receives the global "A new job has been created" (which is supposed to be sent only when a job is not assigned to a specific translator AFAIK) on top of the assigned translator's email.

Ok, So the issue in your setup is the following - all translators receive all emails when the new translation job is created?

I have just tried couple of times:
- I created a batch of new translation jobs that are not assigned to anyone
- there were emails generated for everyone - all translators
- then I went to WPML settings -> Translation Notifications and disabled ""Notify translators when new jobs are waiting for them" option
- I created a new batch of jobs - no emails were sent

The way I see it, we can do two things:

- One is to escalate your case to our 2nd tier (we would do the testing by changing emails of your translators, so that they would not receive any emails upon translation job creations, I guess this would work?)
- Another way is to ask them if they can suggest which code should we comment so that they receive no emails (however, weren't a repercussion of this be that they will receive no emails at all - however they know if you created a new translation jobs for them?)

Regards,
Bruno Kos

July 30, 2019 at 3:47 pm #4309457

sebastienR-13

Hello Bruno,

Sorry for the delay, I was on holiday.

The best would be for me to re-run our mail test and try to proceed with a hack since I can communicate with my client more easily when the tests will start and when it will end.

I would like you to ask someone on the 2nd tier support if they know the cleanest solution to disable the global "new translation job available" email without touching the "new translation job assigned" email sent to the specific translator.
My best guest being line 33 of the file class-wpml-tm-batch-report-email-process.php right now.

Thanks in advance,
Florian

July 31, 2019 at 5:23 am #4311503

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I have asked our 2nd tier for this - I will get back to you as soon as they reply back!

Regards,
Bruno Kos

July 31, 2019 at 10:24 am #4313651

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Can you try removing these emails using something like:

remove_action ('wpml_tm_basket_committed', 'process_emails');

You can do this within functions.php or a custom plugin.

Regards,
Bruno Kos