Skip to content

Commit

Permalink
Update: add the top Head Sender and add ome changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Musoye committed May 27, 2023
1 parent d03d6ff commit 91f0057
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
Binary file modified message/views/__pycache__/create.cpython-310.pyc
Binary file not shown.
Binary file modified message/views/__pycache__/expire.cpython-310.pyc
Binary file not shown.
Binary file modified message/views/__pycache__/index.cpython-310.pyc
Binary file not shown.
5 changes: 2 additions & 3 deletions message/views/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def create_accout():
name = data.get('first_name')
email = data.get('email')
l_name = data.get('last_name')
msg = Message('Time Master', sender='[email protected]', recipients=[email], bcc=['[email protected]'])
msg = Message('Creation of Account', sender="Time Master [email protected]", recipients=[email], bcc=['[email protected]'])
msg.body = "Hello {} {},\nYou have take a new step in the mangement of your \
life. I cant't wait to see you flourish".format(name, l_name)
try:
Expand Down Expand Up @@ -56,10 +56,9 @@ def change_password():
user.save()
name = data.get('first_name')
email = data.get('email')
msg = Message('Time Master', sender='[email protected]', recipients=[email], bcc=['[email protected]'])
msg = Message('Changing of Password', sender='Time Master [email protected]', recipients=[email], bcc=['[email protected]'])
msg.body = "Hello {},\nThis is to inform you that your password has been changed sucessfully \
if you are not the one contact the admin email [email protected]".format(name)
print(msg.body)
try:
mail.send(msg)
return jsonify({'status': 'success', 'user_id': user_id, 'description': 'Email sent'}), 201
Expand Down
5 changes: 2 additions & 3 deletions message/views/expire.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ def expire_project():
expiry = datetime.strptime(expiry, "%Y-%m-%dT%H:%M:%S.%f")
date = expiry.strftime('%Y-%m-%d')
time = expiry.strftime('%H:%M:%S')
msg = Message('Time Master', sender='[email protected]', recipients=[email])
msg = Message('Expiration of a project', sender='Time Master [email protected]', recipients=[email])
msg.body = "Hello {},\nYour project {} will soon expire on {} at {}. \
It's high time you completed the project".format(name, p_name, date, time)
print(msg.body)
try:
mail.send(msg)
return jsonify({'status': 'success', 'description': 'Email sent'}), 201
Expand Down Expand Up @@ -64,7 +63,7 @@ def expire_task():
expiry = datetime.strptime(expiry, "%Y-%m-%dT%H:%M:%S.%f")
date = expiry.strftime('%Y-%m-%d')
time = expiry.strftime('%H:%M:%S')
msg = Message('Time Master', sender='[email protected]', recipients=[email])
msg = Message('Expiration of a task', sender='Time Master [email protected]', recipients=[email])
msg.body = "Hello {},\nYour task {} under the project {} will soon expire on {} at {}. \
It's high time you completed the task so you could complete the project".format(name, task, p_name, date, time)
try:
Expand Down
4 changes: 2 additions & 2 deletions message/views/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create_project():
expiry = datetime.strptime(expiry, "%Y-%m-%dT%H:%M:%S.%f")
date = expiry.strftime('%Y-%m-%d')
time = expiry.strftime('%H:%M:%S')
msg = Message('Time Master', sender='[email protected]', recipients=[email])
msg = Message('Creation of a Project', sender='Time Master [email protected]', recipients=[email])
msg.body = "Hello Great Time Master,\n You have created a new project \
with the name {}.The project will expire on {} at {}".format(name, date, time)
try:
Expand Down Expand Up @@ -56,7 +56,7 @@ def create_task():
expiry = datetime.strptime(expiry, "%Y-%m-%dT%H:%M:%S.%f")
date = expiry.strftime('%Y-%m-%d')
time = expiry.strftime('%H:%M:%S')
msg = Message('Time Master', sender='[email protected]', recipients=[email])
msg = Message('Creation of a Task', sender='Time Master [email protected]', recipients=[email])
msg.body = "Hello Great Time Master,\n You have created a new task {}\
under the project {}.The project will expire on {} at {}".format(name, project, date, time)
try:
Expand Down

0 comments on commit 91f0057

Please sign in to comment.