Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

SparkPost Transaction Options #31

Closed
@djtarazona

Description

@djtarazona

I recently began testing SparkPost for transactional emails and noticed that it was rewriting all my URLs for click tracking and inserting a small image for open tracking. While I think that is fine for marketing / campaign emails, I'd rather have those features disabled for transactional emails.

To disable these features, you need to include an options object in the JSON payload with the appropriate keys such as:

"options": {
    "open_tracking": false,
    "click_tracking": false,
    "transactional": true
}

There isn't an easy way to do this — you must extend/override the send method in SparkPostTransport. I propose adding an options array to the sparkpost service configuration.

'sparkpost' => [
    'secret' => env('SPARKPOST_SECRET'),
    'options' => [
        'open_tracking' => false,
        'click_tracking' => false,
        'transactional' => true,
    ],
],

Maybe not adding this to the default services.php config, but at least supporting it? I'd be happy to make this improvement and submit a pull request. I feel like most users will send transactional email from Laravel and may want to opt-out of these features as well. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions