Move syncMailjetContact() function to the queue

Created on 4 May 2023, over 1 year ago
Updated 9 May 2023, over 1 year ago

Problem/Motivation

In mailjet.module file we have a hooks: mailjet_user_insert(), mailjet_user_update(), mailjet_user_delete(), which are triggers syncMailjetContact(). The problem is syncMailjetContact() function made a POST request to the Mailjet API to update user info, and sometimes these requests can fail, generating a WSOD error on the website.

Error message:
GuzzleHttp\Exception\ConnectException: cURL error 28: Connection timeout after 2000 ms (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in GuzzleHttp\Handler\CurlFactory::createRejection() (line 200 of /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php).

Steps to reproduce

Create, update, or delete a user on the website. But this error appears from time to time.

Proposed resolution

Instead of making requests to the Mailjet API when the user was updated, created, or removed, we can add it to the queue and process all of them during the cron run.

✨ Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine _shy Ukraine, Lutsk πŸ‡ΊπŸ‡¦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024