• Resolved Mattheeuwsk

    (@mattheeuwsk)


    Hello,

    I have been using this plugin since forever and love to stick with it!
    Since the GDPR in EU we are currently switching to Sendgrid EU version, but this doesn’t work with the current setup.
    In the plugin when selecting, there should be a radio button to select US or EU ( as there is with Mailgun for example ).
    On selecting EU it should send to protected $url = ‘https://api.eu.sendgrid.com/v3/mail/send’; instead of protected $url = ‘https://api.sendgrid.com/v3/mail/send’; for the US version.

    This is the only thing holding it back for EU users vo fully use this.

    Is this something that can be added?

    Cheers

Viewing 1 replies (of 1 total)
  • Plugin Support Patrick

    (@paddyam)

    Hi @mattheeuwsk,

    Thanks for reaching out to us! To get the SendGrid mailer working with the EU version, please use the snippet below.

    add_filter( 'pre_http_request', function ( $preempt, $args, $url ) {
    if ( $preempt !== false ) {
    return $preempt;
    }

    if ( strpos( $url, 'https://api.sendgrid.com/v3/mail/send' ) !== false ) {
    $url = str_replace(
    'api.sendgrid.com/v3/mail/send',
    'api.eu.sendgrid.com/v3/mail/send',
    $url
    );

    return wp_remote_request( $url, $args );
    }

    return $preempt;
    }, 10, 3 );

    This should ensure proper configuration and smooth integration with your setup.

    Thanks and all the best.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.