Fossil SCM
Fix minor problems in email notification.
Commit
1cdf6f2049f7658e16fac9034d105cb15f2f659e51eaa9dc260241e6901d6014
Parent
b77f1aaed000fbe…
1 file changed
+20
-16
+20
-16
| --- src/email.c | ||
| +++ src/email.c | ||
| @@ -70,11 +70,11 @@ | ||
| 70 | 70 | @ -- 'c4413' means check-in with rid=4413. |
| 71 | 71 | @ -- |
| 72 | 72 | @ CREATE TABLE repository.pending_alert( |
| 73 | 73 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 74 | 74 | @ sentSep BOOLEAN DEFAULT false, -- individual emails sent |
| 75 | -@ sendDigest BOOLEAN DEFAULT false -- digest emails sent | |
| 75 | +@ sentDigest BOOLEAN DEFAULT false -- digest emails sent | |
| 76 | 76 | @ ) WITHOUT ROWID; |
| 77 | 77 | @ |
| 78 | 78 | @ -- Record bounced emails. If too many bounces are received within |
| 79 | 79 | @ -- some defined time range, then cancel the subscription. Older |
| 80 | 80 | @ -- entries are periodically purged. |
| @@ -468,10 +468,11 @@ | ||
| 468 | 468 | ** a cron-job to make sure alerts are sent |
| 469 | 469 | ** in a timely manner. |
| 470 | 470 | ** Options: |
| 471 | 471 | ** |
| 472 | 472 | ** --digest Send digests |
| 473 | +** --test Resets to standard output | |
| 473 | 474 | ** |
| 474 | 475 | ** inbound [FILE] Receive an inbound email message. This message |
| 475 | 476 | ** is analyzed to see if it is a bounce, and if |
| 476 | 477 | ** necessary, subscribers may be disabled. |
| 477 | 478 | ** |
| @@ -504,10 +505,13 @@ | ||
| 504 | 505 | zCmd = g.argc>=3 ? g.argv[2] : "x"; |
| 505 | 506 | nCmd = (int)strlen(zCmd); |
| 506 | 507 | if( strncmp(zCmd, "exec", nCmd)==0 ){ |
| 507 | 508 | u32 eFlags = 0; |
| 508 | 509 | if( find_option("digest",0,0)!=0 ) eFlags |= SENDALERT_DIGEST; |
| 510 | + if( find_option("test",0,0)!=0 ){ | |
| 511 | + eFlags |= SENDALERT_PRESERVE|SENDALERT_STDOUT; | |
| 512 | + } | |
| 509 | 513 | verify_all_options(); |
| 510 | 514 | email_send_alerts(eFlags); |
| 511 | 515 | }else |
| 512 | 516 | if( strncmp(zCmd, "inbound", nCmd)==0 ){ |
| 513 | 517 | Blob email; |
| @@ -1434,34 +1438,33 @@ | ||
| 1434 | 1438 | blob_appendf(pOut, "\n%.72c\nTo unsubscribe: %s/unsubscribe\n", |
| 1435 | 1439 | '-', db_get("email-url","http://localhost:8080")); |
| 1436 | 1440 | } |
| 1437 | 1441 | |
| 1438 | 1442 | /* |
| 1439 | -** COMMAND: test-generate-alert | |
| 1443 | +** COMMAND: test-alert | |
| 1440 | 1444 | ** |
| 1441 | -** Usage: %fossil test-generate-alert [--html] [--actual] EVENTID ... | |
| 1445 | +** Usage: %fossil test-alert EVENTID ... | |
| 1442 | 1446 | ** |
| 1443 | 1447 | ** Generate the text of an email alert for all of the EVENTIDs |
| 1444 | -** listed on the command-line. Write that text to standard | |
| 1445 | -** output. If the --actual flag is present, then the EVENTIDs are | |
| 1446 | -** the actual event-ids in the pending_alert table. | |
| 1448 | +** listed on the command-line. Or if no events are listed on the | |
| 1449 | +** command line, generate text for all events named in the | |
| 1450 | +** pending_alert table. | |
| 1447 | 1451 | ** |
| 1448 | 1452 | ** This command is intended for testing and debugging the logic |
| 1449 | 1453 | ** that generates email alert text. |
| 1450 | 1454 | */ |
| 1451 | -void test_generate_alert_cmd(void){ | |
| 1452 | - int bActual = find_option("actual",0,0)!=0; | |
| 1455 | +void test_alert_cmd(void){ | |
| 1453 | 1456 | Blob out; |
| 1454 | 1457 | int nEvent; |
| 1455 | 1458 | EmailEvent *pEvent, *p; |
| 1456 | 1459 | |
| 1457 | 1460 | db_find_and_open_repository(0, 0); |
| 1458 | 1461 | verify_all_options(); |
| 1459 | 1462 | db_begin_transaction(); |
| 1460 | 1463 | email_schema(); |
| 1461 | 1464 | db_multi_exec("CREATE TEMP TABLE wantalert(eventid TEXT)"); |
| 1462 | - if( bActual ){ | |
| 1465 | + if( g.argc==2 ){ | |
| 1463 | 1466 | db_multi_exec("INSERT INTO wantalert SELECT eventid FROM pending_alert"); |
| 1464 | 1467 | }else{ |
| 1465 | 1468 | int i; |
| 1466 | 1469 | for(i=2; i<g.argc; i++){ |
| 1467 | 1470 | db_multi_exec("INSERT INTO wantalert VALUES(%Q)", g.argv[i]); |
| @@ -1495,11 +1498,11 @@ | ||
| 1495 | 1498 | db_find_and_open_repository(0, 0); |
| 1496 | 1499 | verify_all_options(); |
| 1497 | 1500 | db_begin_transaction(); |
| 1498 | 1501 | email_schema(); |
| 1499 | 1502 | for(i=2; i<g.argc; i++){ |
| 1500 | - db_multi_exec("INSERT INTO pending_alert(eventId) VALUES(%Q)", g.argv[i]); | |
| 1503 | + db_multi_exec("REPLACE INTO pending_alert(eventId) VALUES(%Q)", g.argv[i]); | |
| 1501 | 1504 | } |
| 1502 | 1505 | db_end_transaction(0); |
| 1503 | 1506 | } |
| 1504 | 1507 | |
| 1505 | 1508 | #if INTERFACE |
| @@ -1506,10 +1509,11 @@ | ||
| 1506 | 1509 | /* |
| 1507 | 1510 | ** Flags for email_send_alerts() |
| 1508 | 1511 | */ |
| 1509 | 1512 | #define SENDALERT_DIGEST 0x0001 /* Send a digest */ |
| 1510 | 1513 | #define SENDALERT_PRESERVE 0x0002 /* Do not mark the task as done */ |
| 1514 | +#define SENDALERT_STDOUT 0x0004 /* Print emails instead of sending */ | |
| 1511 | 1515 | |
| 1512 | 1516 | #endif /* INTERFACE */ |
| 1513 | 1517 | |
| 1514 | 1518 | /* |
| 1515 | 1519 | ** Send alert emails to all subscribers |
| @@ -1521,10 +1525,11 @@ | ||
| 1521 | 1525 | const char *zDigest = "false"; |
| 1522 | 1526 | Blob hdr, body; |
| 1523 | 1527 | const char *zUrl; |
| 1524 | 1528 | const char *zRepoName; |
| 1525 | 1529 | const char *zFrom; |
| 1530 | + const char *zDest = (flags & SENDALERT_STDOUT) ? "stdout" : 0; | |
| 1526 | 1531 | |
| 1527 | 1532 | db_begin_transaction(); |
| 1528 | 1533 | if( !email_enabled() ) goto send_alerts_done; |
| 1529 | 1534 | zUrl = db_get("email-url",0); |
| 1530 | 1535 | if( zUrl==0 ) goto send_alerts_done; |
| @@ -1552,13 +1557,13 @@ | ||
| 1552 | 1557 | if( nEvent==0 ) return; |
| 1553 | 1558 | blob_init(&hdr, 0, 0); |
| 1554 | 1559 | blob_init(&body, 0, 0); |
| 1555 | 1560 | db_prepare(&q, |
| 1556 | 1561 | "SELECT" |
| 1557 | - " subscriberCode," /* 0 */ | |
| 1558 | - " semail," /* 1 */ | |
| 1559 | - " ssub" /* 2 */ | |
| 1562 | + " hex(subscriberCode)," /* 0 */ | |
| 1563 | + " semail," /* 1 */ | |
| 1564 | + " ssub" /* 2 */ | |
| 1560 | 1565 | " FROM subscriber" |
| 1561 | 1566 | " WHERE sverified AND NOT sdonotcall" |
| 1562 | 1567 | " AND sdigest IS %s", |
| 1563 | 1568 | zDigest/*safe-for-%s*/ |
| 1564 | 1569 | ); |
| @@ -1569,15 +1574,14 @@ | ||
| 1569 | 1574 | int nHit = 0; |
| 1570 | 1575 | for(p=pEvents; p; p=p->pNext){ |
| 1571 | 1576 | if( strchr(zSub,p->type)==0 ) continue; |
| 1572 | 1577 | if( nHit==0 ){ |
| 1573 | 1578 | blob_appendf(&hdr,"To: %s\n", zEmail); |
| 1574 | - blob_appendf(&hdr,"From: %s\n", zFrom); | |
| 1575 | 1579 | blob_appendf(&hdr,"Subject: %s activity alert\n", zRepoName); |
| 1576 | 1580 | blob_appendf(&body, |
| 1577 | 1581 | "This is an automated email sent by the Fossil repository " |
| 1578 | - "at %s to alert you to changes.\n", | |
| 1582 | + "at %s to report changes.\n", | |
| 1579 | 1583 | zUrl |
| 1580 | 1584 | ); |
| 1581 | 1585 | } |
| 1582 | 1586 | nHit++; |
| 1583 | 1587 | blob_append(&body, "\n", 1); |
| @@ -1584,11 +1588,11 @@ | ||
| 1584 | 1588 | blob_append(&body, blob_buffer(&p->txt), blob_size(&p->txt)); |
| 1585 | 1589 | } |
| 1586 | 1590 | if( nHit==0 ) continue; |
| 1587 | 1591 | blob_appendf(&body,"\n%.72c\nSubscription info: %s/alerts/%s\n", |
| 1588 | 1592 | '-', zUrl, zCode); |
| 1589 | - email_send(&hdr,&body,0,0); | |
| 1593 | + email_send(&hdr,&body,0,zDest); | |
| 1590 | 1594 | blob_truncate(&hdr); |
| 1591 | 1595 | blob_truncate(&body); |
| 1592 | 1596 | } |
| 1593 | 1597 | blob_zero(&hdr); |
| 1594 | 1598 | blob_zero(&body); |
| 1595 | 1599 |
| --- src/email.c | |
| +++ src/email.c | |
| @@ -70,11 +70,11 @@ | |
| 70 | @ -- 'c4413' means check-in with rid=4413. |
| 71 | @ -- |
| 72 | @ CREATE TABLE repository.pending_alert( |
| 73 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 74 | @ sentSep BOOLEAN DEFAULT false, -- individual emails sent |
| 75 | @ sendDigest BOOLEAN DEFAULT false -- digest emails sent |
| 76 | @ ) WITHOUT ROWID; |
| 77 | @ |
| 78 | @ -- Record bounced emails. If too many bounces are received within |
| 79 | @ -- some defined time range, then cancel the subscription. Older |
| 80 | @ -- entries are periodically purged. |
| @@ -468,10 +468,11 @@ | |
| 468 | ** a cron-job to make sure alerts are sent |
| 469 | ** in a timely manner. |
| 470 | ** Options: |
| 471 | ** |
| 472 | ** --digest Send digests |
| 473 | ** |
| 474 | ** inbound [FILE] Receive an inbound email message. This message |
| 475 | ** is analyzed to see if it is a bounce, and if |
| 476 | ** necessary, subscribers may be disabled. |
| 477 | ** |
| @@ -504,10 +505,13 @@ | |
| 504 | zCmd = g.argc>=3 ? g.argv[2] : "x"; |
| 505 | nCmd = (int)strlen(zCmd); |
| 506 | if( strncmp(zCmd, "exec", nCmd)==0 ){ |
| 507 | u32 eFlags = 0; |
| 508 | if( find_option("digest",0,0)!=0 ) eFlags |= SENDALERT_DIGEST; |
| 509 | verify_all_options(); |
| 510 | email_send_alerts(eFlags); |
| 511 | }else |
| 512 | if( strncmp(zCmd, "inbound", nCmd)==0 ){ |
| 513 | Blob email; |
| @@ -1434,34 +1438,33 @@ | |
| 1434 | blob_appendf(pOut, "\n%.72c\nTo unsubscribe: %s/unsubscribe\n", |
| 1435 | '-', db_get("email-url","http://localhost:8080")); |
| 1436 | } |
| 1437 | |
| 1438 | /* |
| 1439 | ** COMMAND: test-generate-alert |
| 1440 | ** |
| 1441 | ** Usage: %fossil test-generate-alert [--html] [--actual] EVENTID ... |
| 1442 | ** |
| 1443 | ** Generate the text of an email alert for all of the EVENTIDs |
| 1444 | ** listed on the command-line. Write that text to standard |
| 1445 | ** output. If the --actual flag is present, then the EVENTIDs are |
| 1446 | ** the actual event-ids in the pending_alert table. |
| 1447 | ** |
| 1448 | ** This command is intended for testing and debugging the logic |
| 1449 | ** that generates email alert text. |
| 1450 | */ |
| 1451 | void test_generate_alert_cmd(void){ |
| 1452 | int bActual = find_option("actual",0,0)!=0; |
| 1453 | Blob out; |
| 1454 | int nEvent; |
| 1455 | EmailEvent *pEvent, *p; |
| 1456 | |
| 1457 | db_find_and_open_repository(0, 0); |
| 1458 | verify_all_options(); |
| 1459 | db_begin_transaction(); |
| 1460 | email_schema(); |
| 1461 | db_multi_exec("CREATE TEMP TABLE wantalert(eventid TEXT)"); |
| 1462 | if( bActual ){ |
| 1463 | db_multi_exec("INSERT INTO wantalert SELECT eventid FROM pending_alert"); |
| 1464 | }else{ |
| 1465 | int i; |
| 1466 | for(i=2; i<g.argc; i++){ |
| 1467 | db_multi_exec("INSERT INTO wantalert VALUES(%Q)", g.argv[i]); |
| @@ -1495,11 +1498,11 @@ | |
| 1495 | db_find_and_open_repository(0, 0); |
| 1496 | verify_all_options(); |
| 1497 | db_begin_transaction(); |
| 1498 | email_schema(); |
| 1499 | for(i=2; i<g.argc; i++){ |
| 1500 | db_multi_exec("INSERT INTO pending_alert(eventId) VALUES(%Q)", g.argv[i]); |
| 1501 | } |
| 1502 | db_end_transaction(0); |
| 1503 | } |
| 1504 | |
| 1505 | #if INTERFACE |
| @@ -1506,10 +1509,11 @@ | |
| 1506 | /* |
| 1507 | ** Flags for email_send_alerts() |
| 1508 | */ |
| 1509 | #define SENDALERT_DIGEST 0x0001 /* Send a digest */ |
| 1510 | #define SENDALERT_PRESERVE 0x0002 /* Do not mark the task as done */ |
| 1511 | |
| 1512 | #endif /* INTERFACE */ |
| 1513 | |
| 1514 | /* |
| 1515 | ** Send alert emails to all subscribers |
| @@ -1521,10 +1525,11 @@ | |
| 1521 | const char *zDigest = "false"; |
| 1522 | Blob hdr, body; |
| 1523 | const char *zUrl; |
| 1524 | const char *zRepoName; |
| 1525 | const char *zFrom; |
| 1526 | |
| 1527 | db_begin_transaction(); |
| 1528 | if( !email_enabled() ) goto send_alerts_done; |
| 1529 | zUrl = db_get("email-url",0); |
| 1530 | if( zUrl==0 ) goto send_alerts_done; |
| @@ -1552,13 +1557,13 @@ | |
| 1552 | if( nEvent==0 ) return; |
| 1553 | blob_init(&hdr, 0, 0); |
| 1554 | blob_init(&body, 0, 0); |
| 1555 | db_prepare(&q, |
| 1556 | "SELECT" |
| 1557 | " subscriberCode," /* 0 */ |
| 1558 | " semail," /* 1 */ |
| 1559 | " ssub" /* 2 */ |
| 1560 | " FROM subscriber" |
| 1561 | " WHERE sverified AND NOT sdonotcall" |
| 1562 | " AND sdigest IS %s", |
| 1563 | zDigest/*safe-for-%s*/ |
| 1564 | ); |
| @@ -1569,15 +1574,14 @@ | |
| 1569 | int nHit = 0; |
| 1570 | for(p=pEvents; p; p=p->pNext){ |
| 1571 | if( strchr(zSub,p->type)==0 ) continue; |
| 1572 | if( nHit==0 ){ |
| 1573 | blob_appendf(&hdr,"To: %s\n", zEmail); |
| 1574 | blob_appendf(&hdr,"From: %s\n", zFrom); |
| 1575 | blob_appendf(&hdr,"Subject: %s activity alert\n", zRepoName); |
| 1576 | blob_appendf(&body, |
| 1577 | "This is an automated email sent by the Fossil repository " |
| 1578 | "at %s to alert you to changes.\n", |
| 1579 | zUrl |
| 1580 | ); |
| 1581 | } |
| 1582 | nHit++; |
| 1583 | blob_append(&body, "\n", 1); |
| @@ -1584,11 +1588,11 @@ | |
| 1584 | blob_append(&body, blob_buffer(&p->txt), blob_size(&p->txt)); |
| 1585 | } |
| 1586 | if( nHit==0 ) continue; |
| 1587 | blob_appendf(&body,"\n%.72c\nSubscription info: %s/alerts/%s\n", |
| 1588 | '-', zUrl, zCode); |
| 1589 | email_send(&hdr,&body,0,0); |
| 1590 | blob_truncate(&hdr); |
| 1591 | blob_truncate(&body); |
| 1592 | } |
| 1593 | blob_zero(&hdr); |
| 1594 | blob_zero(&body); |
| 1595 |
| --- src/email.c | |
| +++ src/email.c | |
| @@ -70,11 +70,11 @@ | |
| 70 | @ -- 'c4413' means check-in with rid=4413. |
| 71 | @ -- |
| 72 | @ CREATE TABLE repository.pending_alert( |
| 73 | @ eventid TEXT PRIMARY KEY, -- Object that changed |
| 74 | @ sentSep BOOLEAN DEFAULT false, -- individual emails sent |
| 75 | @ sentDigest BOOLEAN DEFAULT false -- digest emails sent |
| 76 | @ ) WITHOUT ROWID; |
| 77 | @ |
| 78 | @ -- Record bounced emails. If too many bounces are received within |
| 79 | @ -- some defined time range, then cancel the subscription. Older |
| 80 | @ -- entries are periodically purged. |
| @@ -468,10 +468,11 @@ | |
| 468 | ** a cron-job to make sure alerts are sent |
| 469 | ** in a timely manner. |
| 470 | ** Options: |
| 471 | ** |
| 472 | ** --digest Send digests |
| 473 | ** --test Resets to standard output |
| 474 | ** |
| 475 | ** inbound [FILE] Receive an inbound email message. This message |
| 476 | ** is analyzed to see if it is a bounce, and if |
| 477 | ** necessary, subscribers may be disabled. |
| 478 | ** |
| @@ -504,10 +505,13 @@ | |
| 505 | zCmd = g.argc>=3 ? g.argv[2] : "x"; |
| 506 | nCmd = (int)strlen(zCmd); |
| 507 | if( strncmp(zCmd, "exec", nCmd)==0 ){ |
| 508 | u32 eFlags = 0; |
| 509 | if( find_option("digest",0,0)!=0 ) eFlags |= SENDALERT_DIGEST; |
| 510 | if( find_option("test",0,0)!=0 ){ |
| 511 | eFlags |= SENDALERT_PRESERVE|SENDALERT_STDOUT; |
| 512 | } |
| 513 | verify_all_options(); |
| 514 | email_send_alerts(eFlags); |
| 515 | }else |
| 516 | if( strncmp(zCmd, "inbound", nCmd)==0 ){ |
| 517 | Blob email; |
| @@ -1434,34 +1438,33 @@ | |
| 1438 | blob_appendf(pOut, "\n%.72c\nTo unsubscribe: %s/unsubscribe\n", |
| 1439 | '-', db_get("email-url","http://localhost:8080")); |
| 1440 | } |
| 1441 | |
| 1442 | /* |
| 1443 | ** COMMAND: test-alert |
| 1444 | ** |
| 1445 | ** Usage: %fossil test-alert EVENTID ... |
| 1446 | ** |
| 1447 | ** Generate the text of an email alert for all of the EVENTIDs |
| 1448 | ** listed on the command-line. Or if no events are listed on the |
| 1449 | ** command line, generate text for all events named in the |
| 1450 | ** pending_alert table. |
| 1451 | ** |
| 1452 | ** This command is intended for testing and debugging the logic |
| 1453 | ** that generates email alert text. |
| 1454 | */ |
| 1455 | void test_alert_cmd(void){ |
| 1456 | Blob out; |
| 1457 | int nEvent; |
| 1458 | EmailEvent *pEvent, *p; |
| 1459 | |
| 1460 | db_find_and_open_repository(0, 0); |
| 1461 | verify_all_options(); |
| 1462 | db_begin_transaction(); |
| 1463 | email_schema(); |
| 1464 | db_multi_exec("CREATE TEMP TABLE wantalert(eventid TEXT)"); |
| 1465 | if( g.argc==2 ){ |
| 1466 | db_multi_exec("INSERT INTO wantalert SELECT eventid FROM pending_alert"); |
| 1467 | }else{ |
| 1468 | int i; |
| 1469 | for(i=2; i<g.argc; i++){ |
| 1470 | db_multi_exec("INSERT INTO wantalert VALUES(%Q)", g.argv[i]); |
| @@ -1495,11 +1498,11 @@ | |
| 1498 | db_find_and_open_repository(0, 0); |
| 1499 | verify_all_options(); |
| 1500 | db_begin_transaction(); |
| 1501 | email_schema(); |
| 1502 | for(i=2; i<g.argc; i++){ |
| 1503 | db_multi_exec("REPLACE INTO pending_alert(eventId) VALUES(%Q)", g.argv[i]); |
| 1504 | } |
| 1505 | db_end_transaction(0); |
| 1506 | } |
| 1507 | |
| 1508 | #if INTERFACE |
| @@ -1506,10 +1509,11 @@ | |
| 1509 | /* |
| 1510 | ** Flags for email_send_alerts() |
| 1511 | */ |
| 1512 | #define SENDALERT_DIGEST 0x0001 /* Send a digest */ |
| 1513 | #define SENDALERT_PRESERVE 0x0002 /* Do not mark the task as done */ |
| 1514 | #define SENDALERT_STDOUT 0x0004 /* Print emails instead of sending */ |
| 1515 | |
| 1516 | #endif /* INTERFACE */ |
| 1517 | |
| 1518 | /* |
| 1519 | ** Send alert emails to all subscribers |
| @@ -1521,10 +1525,11 @@ | |
| 1525 | const char *zDigest = "false"; |
| 1526 | Blob hdr, body; |
| 1527 | const char *zUrl; |
| 1528 | const char *zRepoName; |
| 1529 | const char *zFrom; |
| 1530 | const char *zDest = (flags & SENDALERT_STDOUT) ? "stdout" : 0; |
| 1531 | |
| 1532 | db_begin_transaction(); |
| 1533 | if( !email_enabled() ) goto send_alerts_done; |
| 1534 | zUrl = db_get("email-url",0); |
| 1535 | if( zUrl==0 ) goto send_alerts_done; |
| @@ -1552,13 +1557,13 @@ | |
| 1557 | if( nEvent==0 ) return; |
| 1558 | blob_init(&hdr, 0, 0); |
| 1559 | blob_init(&body, 0, 0); |
| 1560 | db_prepare(&q, |
| 1561 | "SELECT" |
| 1562 | " hex(subscriberCode)," /* 0 */ |
| 1563 | " semail," /* 1 */ |
| 1564 | " ssub" /* 2 */ |
| 1565 | " FROM subscriber" |
| 1566 | " WHERE sverified AND NOT sdonotcall" |
| 1567 | " AND sdigest IS %s", |
| 1568 | zDigest/*safe-for-%s*/ |
| 1569 | ); |
| @@ -1569,15 +1574,14 @@ | |
| 1574 | int nHit = 0; |
| 1575 | for(p=pEvents; p; p=p->pNext){ |
| 1576 | if( strchr(zSub,p->type)==0 ) continue; |
| 1577 | if( nHit==0 ){ |
| 1578 | blob_appendf(&hdr,"To: %s\n", zEmail); |
| 1579 | blob_appendf(&hdr,"Subject: %s activity alert\n", zRepoName); |
| 1580 | blob_appendf(&body, |
| 1581 | "This is an automated email sent by the Fossil repository " |
| 1582 | "at %s to report changes.\n", |
| 1583 | zUrl |
| 1584 | ); |
| 1585 | } |
| 1586 | nHit++; |
| 1587 | blob_append(&body, "\n", 1); |
| @@ -1584,11 +1588,11 @@ | |
| 1588 | blob_append(&body, blob_buffer(&p->txt), blob_size(&p->txt)); |
| 1589 | } |
| 1590 | if( nHit==0 ) continue; |
| 1591 | blob_appendf(&body,"\n%.72c\nSubscription info: %s/alerts/%s\n", |
| 1592 | '-', zUrl, zCode); |
| 1593 | email_send(&hdr,&body,0,zDest); |
| 1594 | blob_truncate(&hdr); |
| 1595 | blob_truncate(&body); |
| 1596 | } |
| 1597 | blob_zero(&hdr); |
| 1598 | blob_zero(&body); |
| 1599 |