• Resolved B

    (@bh8489)


    Hi SendGrid / all,

    I’m trying to send a message with a delay (send in one hour), so I’d like to use the send_at attribute of the x-smtpapi. I’m sending with a valid API key, declared in my wp-config.php file, and messages are being send through sendgrid– they’re just ignoring the send_at parameter. Is what I want possible? Am I using the wrong format, or is this not supported over API/apikey auth?

    I’ve tried a few things that don’t seem to be working… (note below, $sendTime is the epoch UTC time one hour in the future and I’ve verified this is set correctly.

    $headers[] = 'X-SMTPAPI: { "send_at": '.$sendTime.' }';
    wp_mail( $to, $subject, $message, $headers, $attachments );
    $headers[] = 'x-smtpapi-send_at: '.$sendTime;
    wp_mail( $to, $subject, $message, $headers, $attachments );
    $headers[] = "send_at: " . $sendTime;
    wp_mail( $to, $subject, $message, $headers, $attachments );

    Note, I am adding categories with:
    $headers[] = 'categories: myCategory';
    and that works successfully.

    Thanks a bunch for any guidance!

    https://wordpress.org/plugins/sendgrid-email-delivery-simplified/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter B

    (@bh8489)

    By the way, if the issue is that I’m authenticating with API key instead of SMTP credentials: can you advise any alternative solution? My host blocks outgoing SMTP. Many thanks.

    Thread Starter B

    (@bh8489)

    Helpful update from SendGrid support:

    Currently the WordPress plugin does not support the send_at parameter and adding it in your own X-SMTPAPI header will not work as our system only supports one header to be read.

    This would be a super useful feature, if not in the backend, just to be able to add manually to $headers in wp_mail().

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

The topic ‘send_at’ is closed to new replies.