Skip to content

Conversation

@mikecabana
Copy link

@mikecabana mikecabana commented May 18, 2021

Email setting or query variables will overwrite the custom headers like here

if (isset($from) && !empty($from)) {
    $headers[] = 'From: ' . $from;
} else if (isset($defaultFrom) && !empty($defaultFrom)) {
     $headers[] = 'From: ' . $defaultFrom;
}

Fixes #3

'description' => __('Body of email', 'wp-graphql-send-mail'),
],
'headers' => [
'type' => 'String',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be
['type' => ['list_of' => 'String']]
To allow for an array of headers to be sent?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It definitely can, I just wanted to keep it simple and use the same logic as the origins since I'm not too savvy in PHP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't manually set email headers

3 participants