Real email queue
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
psiphon |
Fix Committed
|
High
|
Unassigned |
Bug Description
Change code to use real STMP email queue instead of SQL table queue.
From an email:
I think all our PHP code sends email via the enqueue_email function in
email_helpers.php:
function enqueue_email(
$config,
$email,
$subject,
$body,
$lang)
{
$query =
"INSERT INTO email_queue (recipient_
body, lang) ".
"VALUES ( :email, :subject, :body, :lang )";
db_
convert_
":body" => $body, ":lang" => $lang)));
}
So to test the new method, it looks easy to change that function to
call smail_plain directly.
Looking at send_email_
invitations. What's the impact on that with this change? How
important is it that the invitation table is only updated when the
email is really sent vs. enqueued in the system?
smail_plain call:
if (!smail_plain(
"",
"",
"",
{
echo "smail_plain failed for address:
".$recordrecipi
}
extra SQL:
// Update the invitation table to reflect that the email has been sent.
// If this email is not an invitation, this statement will have no effect.
// (Queued email can be for purposes other than invitations --
i.e., provisioning.)
$query =
"UPDATE invitation ".
"SET status = UNIX_TIMESTAMP(), email_queue_id = NULL ".
"WHERE email_queue_id = :email_queue_id";
if (!db_query_
convert_
{
}
tags: | added: category1 |
Changed in psiphon: | |
status: | Confirmed → Fix Committed |
Somehow didn't get migrated from Trac. Was ticket #171