Fossil

Check-in [2c3b9030]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Futher corrections to the email alert trigger.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:2c3b903043c65cbf30355d7585797a140ad448e165d7d91b725ea365d5f125e8
User & Date: drh 2018-06-23 01:33:27
Context
2018-06-23
14:24
Rework the internal email sending logic so that it is connection-oriented. This makes it more efficient and makes it easier to add support for an SMTP sending method at a later date. check-in: b4218987 user: drh tags: trunk
01:33
Futher corrections to the email alert trigger. check-in: 2c3b9030 user: drh tags: trunk
01:26
Fix minor problems with email notification. check-in: d7ccfb64 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/email.c.

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
*/
void email_triggers_enable(void){
  if( !db_table_exists("repository","pending_alert") ) return;
  db_multi_exec(
    "CREATE TRIGGER IF NOT EXISTS repository.email_trigger1\n"
    "AFTER INSERT ON event BEGIN\n"
    "  INSERT INTO pending_alert(eventid)\n"
    "    SELECT printf('%%.1c%%d',new.type,new.objid),"
    "           julianday('now') WHERE true\n"
    "    ON CONFLICT(eventId) DO NOTHING;\n"
    "END;"
  );
}

/*
** Disable triggers the event_pending triggers.







|
<







102
103
104
105
106
107
108
109

110
111
112
113
114
115
116
*/
void email_triggers_enable(void){
  if( !db_table_exists("repository","pending_alert") ) return;
  db_multi_exec(
    "CREATE TRIGGER IF NOT EXISTS repository.email_trigger1\n"
    "AFTER INSERT ON event BEGIN\n"
    "  INSERT INTO pending_alert(eventid)\n"
    "    SELECT printf('%%.1c%%d',new.type,new.objid) WHERE true\n"

    "    ON CONFLICT(eventId) DO NOTHING;\n"
    "END;"
  );
}

/*
** Disable triggers the event_pending triggers.