Title: [264752] trunk/Tools
Revision
264752
Author
aakash_j...@apple.com
Date
2020-07-23 03:44:27 -0700 (Thu, 23 Jul 2020)

Log Message

[ews] Add support to send emails in ews
https://bugs.webkit.org/show_bug.cgi?id=214670

Reviewed by Darin Adler.

* BuildSlaveSupport/ews-build/send_email.py: Added script to send emails.
(send_email):
(send_email_to_bot_watchers):

Modified Paths

Added Paths

Diff

Added: trunk/Tools/BuildSlaveSupport/ews-build/send_email.py (0 => 264752)


--- trunk/Tools/BuildSlaveSupport/ews-build/send_email.py	                        (rev 0)
+++ trunk/Tools/BuildSlaveSupport/ews-build/send_email.py	2020-07-23 10:44:27 UTC (rev 264752)
@@ -0,0 +1,39 @@
+# Copyright (C) 2020 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import smtplib
+
+BOT_WATCHERS_EMAILS = ['webkit-bot-watchers-bugzi...@group.apple.com']
+FROM_EMAIL = 'e...@webkit.org'
+SERVER = 'localhost'
+
+
+def send_email(to_emails, subject, text):
+    email_data = """From: {}\nTo: {}\nSubject: {}\n\n{}""".format(FROM_EMAIL, ', '.join(to_emails), subject, text)
+
+    server = smtplib.SMTP(SERVER)
+    server.sendmail(FROM_EMAIL, to_emails, email_data)
+    server.quit()
+
+
+def send_email_to_bot_watchers(subject, text):
+    send_email(BOT_WATCHERS_EMAILS, subject, text)

Modified: trunk/Tools/ChangeLog (264751 => 264752)


--- trunk/Tools/ChangeLog	2020-07-23 08:49:40 UTC (rev 264751)
+++ trunk/Tools/ChangeLog	2020-07-23 10:44:27 UTC (rev 264752)
@@ -1,3 +1,14 @@
+2020-07-23  Aakash Jain  <aakash_j...@apple.com>
+
+        [ews] Add support to send emails in ews
+        https://bugs.webkit.org/show_bug.cgi?id=214670
+
+        Reviewed by Darin Adler.
+
+        * BuildSlaveSupport/ews-build/send_email.py: Added script to send emails.
+        (send_email):
+        (send_email_to_bot_watchers):
+
 2020-07-22  Conrad Shultz  <conrad_shu...@apple.com>
 
         Update macOS Version macros
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to