demon326
Legacy Member
Hallo iedereen, zeer binnenkort gaan we onze gebruikers laten gebruik maken van de invite module van drupal, maar gezien we op een shared host zitten zouden we gebruiken maken van de Job queue module, maar als ik de uitleg daar toepas op de regel die de mails verzend krijg ik pars erros, en dat is niet de bedoeling hé
de block code waar het mij dus niet lukt.
uitleg:
becomes
Wie me hier mee kan helpen zal ik heel dankbaar zijn
.
Mvg,
Benny
PHP:
if (!($success = drupal_mail('invite-mail', $recipient, $subject, wordwrap($body, 72), $from, $headers))) {
static $error_shown = FALSE;
if (!$error_shown) {
drupal_set_message(t('Problems occurred while sending the invitation(s). Please contact the site administrator.'), 'error');
$error_shown = TRUE;
}
watchdog('invite', t('Failed sending invitation. To: @email From: @from', array('@email' => '<'. $recipient .'>', '@from' => '<'. $from .'>')));
}
return $success;
}
de block code waar het mij dus niet lukt.
uitleg:
Normally, to send email from Drupal, the drupal_mail function is used directly to send email. If many emails must be sent at one time, however, this process may cause PHP to time out. Instead, job_queue_add() may be used to queue the job to eventually be executed as cron runs and the job_queue module processes the job queue.
PHP:
<?php
drupal_mail('some-email-id', $to, $subject, $body, $from, $headers);
?>
PHP:
<?php
job_queue_add('drupal_mail', 'Description of the email process', array('some-email-id', $to, $subject, $body, $from, $headers), '', TRUE);
?>
Wie me hier mee kan helpen zal ik heel dankbaar zijn
.Mvg,
Benny
, zit zo ook in de core gebouwd: