##// END OF EJS Templates
utils: added code for sending test emails.
marcink -
r4439:1d4ce874 default
parent child
Show More
@@ -30,6 +30,7 import os
30 import re
30 import re
31 import sys
31 import sys
32 import shutil
32 import shutil
33 import socket
33 import tempfile
34 import tempfile
34 import traceback
35 import traceback
35 import tarfile
36 import tarfile
@@ -782,3 +783,18 def generate_platform_uuid():
782 except Exception as e:
783 except Exception as e:
783 log.error('Failed to generate host uuid: %s', e)
784 log.error('Failed to generate host uuid: %s', e)
784 return 'UNDEFINED'
785 return 'UNDEFINED'
786
787
788 def send_test_email(recipients, email_body='TEST EMAIL'):
789 """
790 Simple code for generating test emails.
791 Usage::
792
793 from rhodecode.lib import utils
794 utils.send_test_email()
795 """
796 from rhodecode.lib.celerylib import tasks, run_task
797
798 email_body = email_body_plaintext = email_body
799 subject = 'SUBJECT FROM: {}'.format(socket.gethostname())
800 tasks.send_email(recipients, subject, email_body_plaintext, email_body)
General Comments 0
You need to be logged in to leave comments. Login now