Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Composer Manager (https://drupal.org/project/composer_manager)
You could install and enable SendGrid PHP Library with Composer Manager.
If not, module will try to find sendgrid/vendor/autoload.php file and SendGrid class.

Then enable module as usual and enter SendGrid API key in module settings. And enable module to be used in Mail System settings.
Then enable module as usual and enter your SendGrid API key in the module settings. Also configure your site's Mail System settings to use Sendgrid.

9 changes: 8 additions & 1 deletion src/Form/SendgridAdminSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,20 @@ public function buildForm(array $form, FormStateInterface $form_state) {
// '#description' => t('Whether or not to strip the query string from URLs when aggregating tracked URL data.'),
// '#default_value' => $config->get('sendgrid_url_strip_qs'),
// );
if (\Drupal::moduleHandler()->moduleExists('dblog')) {
$log_url = Url::fromRoute('dblog.overview');
} elseif (\Drupal::moduleHandler()->moduleExists('syslog') && \Drupal::moduleHandler()->moduleExists('help')) {
$log_url = new Url('help.page', ['name' => 'syslog']);
} else {
$log_url = 'https://drupal.org/page-that-needs-to-exist-on-simply-enabling-dblog-syslog-or-other-compatible-logger';
}
$form['send_options']['sendgrid_log_defaulted_sends'] = array(
'#title' => t('Log sends from module/key pairs that are not registered independently in mailsystem.'),
'#type' => 'checkbox',
'#description' => t('If you select Sendgrid as the site-wide default email sender in %mailsystem and check this box, any messages that are sent through Sendgrid using module/key pairs that are not specifically registered in mailsystem will cause a message to be written to the %systemlog (type: Sendgrid, severity: info). Enable this to identify keys and modules for automated emails for which you would like to have more granular control. It is not recommended to leave this box checked for extended periods, as it slows Sendgrid and can clog your logs.',
array(
'%mailsystem' => $this->l(t('Mail System'), $mailSystemPath),
'%systemlog' => $this->l(t('system log'), Url::fromRoute('dblog.overview')),
'%systemlog' => $this->l(t('system log'), $log_url),
)),
'#default_value' => $config->get('sendgrid_log_defaulted_sends'),
);
Expand Down