Fatal error: Unparenthesized a ? b : c ? d : e
is not supported. Use either (a ? b : c) ? d : e
or a ? b : (c ? d : e)
in /wp-content/plugins/sendgrid-email-delivery-simplified/view/sendgrid_settings_test_email.php on line 22
Can this please be fixed?
]]>Can we hide the API key? Maybe in next update.
]]>Email is sent but wp_mail return false.
I fixed by updating sendMail function of your service :
/**
* Send Mail
* @param string $to
* @param string $subject
* @param string $message
* @param string $headers
* @param array $attachments
*/
public function send_mail($to, $subject, $message, $headers, $attachments = '')
{
$api_key = $this->get_token();
$from_info = get_option('_wp_mailplus_from_info');
$from = new SendGrid\Email($from_info['from_name'], $from_info['from_email']);
$mail_to = new SendGrid\Email(null, $to);
$content = new SendGrid\Content("text/html", $message);
$mail = new SendGrid\Mail($from, $subject, $mail_to, $content);
if(!is_array($attachments) && !empty($attachments)) {
$attachments = explode( "\n", str_replace( "\r\n", "\n", $attachments ) );
}
if(!empty($attachments)) {
foreach($attachments as $single_attachment) {
$attachment = $this->prepareAttachment($single_attachment);
if($attachment)
$mail->addAttachment($attachment);
}
}
$sendGrid = new \SendGrid($api_key);
$email_from = BaseController::prepare_from_email($from_info['from_name'], $from_info['from_email']);
$log_data = array('email_from' => $email_from,
'email_to' => $to,
'email_service' => 'Sendgrid',
'email_subject' => $subject,
'status' => 'Success',
'message' => 'Mail sent successfully'
);
$response = $sendGrid->client->mail()->send()->post($mail);
$status_code = $response->statusCode();
if($status_code != 202) {
$response_body = json_decode($response->body());
if($response_body->errors) {
$error_count = count($response_body->errors);
if($error_count > 0) {
foreach($response_body->errors as $error_key => $error_info) {
$log_data['message'] = $log_data['message'] . ' ' . $error_info->message;
}
$log_data['status'] = 'Failed';
$log_data['message'] = trim($log_data['message']);
}
}
}
BaseController::addLog($log_data);
//Function was not returning any value
if ($log_data['status'] == 'Success') {
return true;
}else{
return false;
}
}
]]>
Hi,
I am using this plugin. Everything seems working fine but when I reset the password using wordpress functionality I get an error message. I recieve the email correctly but get an error. Please check the screenshot here https://i.imgur.com/0DI4rSr.png
Any thoughts on why it happens?
Thanks
]]>Hi,
Your plugin us not working with PHP 8.1
On the settings page, it is giving this Fatal error: Unparenthesized a ? b : c ? d : e
is not supported.
Please check and do what is required, so it can work with the latest PHP version.
]]>I have the SendGrid plugin and using the plugin on my site, when users comment on the post then I receive an email because I am the author of that post but the email format is not proper. When I deactivate the plugin and then any user comments on the post then I receive a proper format email. So this issue is regarding the plugin. I am attaching images for better understanding.
Image link (when plugin activated)
Image link (when the plugin is deactivated)
Thank you.
]]>I am trying to send an email to multiple users without the users seeing each others’ emails in the To field.
Looking through the plugin’s code, it seems SendGrid’s Personalizations is used, but the plugin includes all the emails in one single Personalization, like this
{
"personalizations": [
{
"to": [
{
"email": "[email protected]"
},
{
"email": "[email protected]"
},
{
"email": "[email protected]"
}
],
"subject": "YOUR SUBJECT LINE GOES HERE"
}
]
}
I need them added as an individual Personalization for each email, like this
{
"personalizations": [
{
"to": [
{
"email": "[email protected]"
}
],
"subject": "YOUR SUBJECT LINE GOES HERE"
},
{
"to": [
{
"email": "[email protected]"
}
],
"subject": "YOUR SUBJECT LINE GOES HERE"
},
{
"to": [
{
"email": "[email protected]"
}
],
"subject": "YOUR SUBJECT LINE GOES HERE"
}
]
}
Is this possible with the most recent version of the plugin?
]]>Dear Concern,
We, a group of researchers from University of Virginia and Johns Hopkins University, are analyzing the GDPR compliance in different plugins. From our analysis we found that you are storing ’email’ (PII information) information in the database. Neither you mentioned in your privacy policy that the data will be stored. According to GDPR, whenever you store PII, you need to provide user the data access and data deletion functionality and clearly mention this in privacy policy. Not doing so will violate GDPR law.
Can you please take a look at this issue? If needed we can provide more information on this.
]]>These Notices show up in the error log and should be fixed:
[09-Nov-2020 14:00:14 UTC] PHP Notice: Undefined index: service in …/wp-content/plugins/wp-sendgrid-mailer/includes/views/Logs.php on line 33
[09-Nov-2020 14:00:14 UTC] PHP Notice: Undefined index: status in …/wp-content/plugins/wp-sendgrid-mailer/includes/views/Logs.php on line 45
[09-Nov-2020 14:00:14 UTC] PHP Notice: Undefined index: status in …/wp-content/plugins/wp-sendgrid-mailer/includes/views/Logs.php on line 46
Hi there,
It seems Sendgrid only works if API Key Permissions in Sendgrid are set to “Full Access Permissions”. Could you explain how to use your plugin with Restricted Access Settings?” Which options need to be selected there?
Thank you
]]>Hi there,
Here some suggestions for your plugin:
I believe on your log page, it would be more useful to order the list by default so that the latest emails show first on top (currently the oldest emails show on top, then I have to click 2 times to see the latest and you have to wait too long).
Also there should be a pagination dropdown box to show more entries per page. A default of only 10 entries is way too low.
Then there should be a setitng which allows you to keep only the last 30 days or whatever number of das in the log. This avoids that you have to clean the log all the time manually yourself.
]]>Can the plugin be updated so that those with WP_DEBUG set to true do not see this error?
Deprecated: contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
I think it’s related to this line:
add_filter( ‘contextual_help’, array( __CLASS__, ‘show_contextual_help’ ), 10, 3 );
When I go to the settings page Chrome things the api key is a password field and auto-fills my password (Not sure if it’s Chrome or LastPass). That’s not the problem though.
The problem is that the Sendgrid settings page automatically submits the form when the API field changes. And then it loads back with an error, auto-fills again, submits the form, repeat. I can’t enter an API key because of that.
I was able to work around it using incognito but it would be much easier if the input had autocomplete=”off”. I can’t imagine someone using autofill for an API key anyway.
Thanks
]]>wp-admin/admin.php?page=wp-mailplus-settings
…using Sendgrid API (not SMTP) triggers 3x PHP errors as follows:
Notice
Undefined index: smtp_encryption
wp-content/plugins/wp-sendgrid-mailer/includes/views/Settings.php:57
wp-content/plugins/wp-sendgrid-mailer/includes/views/Settings.php:60
wp-content/plugins/wp-sendgrid-mailer/includes/views/Settings.php:63
]]>