Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(headers): added flow for custom headers #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

@@ -152,6 +168,10 @@ function wpgraphql_send_mail_options_page()
'type' => 'String',
'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