• Resolved undarktaker

    (@undarktaker)


    Hello,

    I’m experiencing a persistent issue with the Mailjet plugin for WordPress. Steps to reproduce:

    1. Go to Mailjet in the WordPress admin menu. URL: /wp-admin/admin.php?page=mailjet_settings_page
    2. Enter the API and secret keys and click “Connect your account.”
    3. After connecting, you are redirected to the Mailjet dashboard at: /wp-admin/admin.php?page=mailjet_dashboard_page
    4. The dashboard is functional. I can access:
      • My Campaigns
      • Subscription Forms
      • Contact Lists
      • Statistics
      This confirms the account is successfully connected.
    5. However, when I return to the Mailjet menu item in the admin, I am again prompted with:
      “Connect your Mailjet account to get started.”

    This message appears repeatedly, even though the account is clearly connected. I can still access the dashboard and other subpages directly via URL, but the main settings page incorrectly assumes I am not connected. Expected behavior:

    Additional problem:
    This issue seems to prevent email notifications from being sent by Gravity Forms. Every time a form is submitted, the following error is logged in the Gravity Forms log:
    WordPress was unable to send the notification email. SMTP Error: Could not connect to SMTP host. Failed to connect to serverSMTP server error: Failed to connect to server SMTP code: 110 Additional SMTP info: Connection timed out.

    Expected behavior:Once the API keys are entered and the account is connected, the plugin should recognize this and no longer ask to connect the account. The SMTP connection should also be established correctly so Gravity Forms and other plugins relying on wp_mail() can send emails without failure.

    Additional info:

    • WordPress Version 6.8.2
    • Admin Menu Editor Pro Version 2.29.1 par Janis Elsts
    • Advanced Custom Fields PRO  Version 6.4.2 par WP Engine
    • Advanced Editor Tools Version 5.9.2 par Automattic
    • Ajax Load More  Version 7.4.2 par Darren Cooney
    • Akismet Anti-spam: Spam Protection  Version 5.5 par Automattic – Anti-spam Team
    • Autoptimize Version 3.1.13 par Frank Goossens (futtta)
    • BBQ Firewall  Version 20250324 par Jeff Starr
    • Block Specific Plugin Updates Version 3.3.2 par Dinesh Karki
    • Classic Editor  Version 1.6.7 par WordPress Contributors
    • Classic Widgets Version 0.3 par WordPress Contributors
    • Enable Gzip Compression Version 1.0.3 par Moki-Moki Ios
    • Gravity Forms Version 2.9.13 par Gravity Forms
    • GTM4WP – A Google Tag Manager (GTM) plugin for WordPress  Version 1.21.1 par Thomas Geiger
    • Mailjet for WordPress Version 6.1.5 par Mailjet SAS
    • ManageWP – Worker Version 4.9.23 par GoDaddy
    • Polylang  Version 3.7.3 par WP SYNTEX
    • Redirection Version 5.5.2 par John Godley
    • SecuPress Free with Simple SSL – Simple and Performant Security Version 2.3.20.1 par SecuPress
    • Simple Page Ordering  Version 2.7.4 par 10up
    • Simple Sitemap  Version 3.6.1 par David Gwyer
    • UpdraftPlus – Backup/Restore  Version 1.25.6 par TeamUpdraft, DavidAnderson
    • Wicked Folders Pro  Version 3.2.3 par Wicked Plugins
    • Yoast Duplicate Post  Version 4.5 par Enrico Battocchi & Team Yoast
    • Yoast SEO Version 25.5 par Team Yoast

    Please let me know if there’s a fix or workaround. I’m happy to provide more details or test a patch.

    Best regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • I have a similar issue, but also my Contact Lists never loads.

    I have the same issue but i have contact forms 7
    I connect the mailjet account all are fine , subscriptions are working but then it seems it loses the connection. It have to be something about session cookie?

    I’m back with a fix!

    Here’s the situation:

    I created a simple PHP file to check if Mailjet credentials are valid:

    <?php
    require_once('wp-load.php');
    use MailjetWp\MailjetPlugin\Includes\MailjetApi;

    var_dump(\MailjetWp\MailjetPlugin\Includes\MailjetApi::isValidAPICredentials());

    I also checked the database to see if the API Key, Secret, and connection flag are present:

    <?php
    require_once(dirname(__FILE__) . '/wp-load.php');

    echo 'API Key: ' . get_option('mailjet_apikey') . '<br>';
    echo 'API Secret: ' . get_option('mailjet_apisecret') . '<br>';
    echo 'Connection Flag: ' . get_option('api_credentials_ok') . '<br>';

    So:

    • MailjetApi::isValidAPICredentials() returns true ✅
    • The DB has the API keys and api_credentials_ok = 1 ✅

    …but you still have to click “Connect your account” every time you visit the Mailjet settings page.

    This means the plugin isn’t actually persisting the session/connection on the admin page — even though the credentials are valid, it always shows the initial settings page.

    The plugin currently uses MailjetSettings::redirectJs() to move to the next step only after submitting the form. It doesn’t check the DB on page load to skip the “Connect your account” screen.

    In other words: the plugin thinks “I need to connect” because it only redirects after form submission, not automatically when api_credentials_ok = 1.

    Temporary solution:

    Until the plugin creators add a proper fix, we can automatically skip the first settings screen if the credentials are already valid.

    Add the following to your functions.php:

    add_action('current_screen', function($screen) {
    if ($screen && $screen->id === 'toplevel_page_mailjet_settings_page') {
    if (get_option('api_credentials_ok')) {
    wp_redirect(admin_url('admin.php?page=mailjet_initial_contact_lists_page'));
    exit;
    }
    }
    });

    This will check if you are on the first Mailjet settings screen, verify the API credentials, and automatically redirect you — just like pressing the “Connect your account” button.

    No need to click the button every time anymore!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Persistent “Connect your Mailjet account” message’ is closed to new replies.