Skip to content

Commit

Permalink
Merge pull request #584 from AI4Bharat/new_bg_music
Browse files Browse the repository at this point in the history
Unsubscribe Pop-up
  • Loading branch information
Shruti1229 authored Dec 7, 2023
2 parents fc75722 + ca21583 commit 3c848d3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
3 changes: 2 additions & 1 deletion backend/newsletter/templates/cl_newsletter_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
</style>
</head>


<body style="background-color:#f9f0e6;">
<div style="display:none;font-size:1px;color:#ffffff;line-height:1px;overflow:hidden;"> Preview - Welcome to Chitralekha </div>
<div style="background-color:#f9f0e6;">
Expand Down Expand Up @@ -160,7 +161,7 @@
</tr>
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div style="font-family:Muli, Arial, sans-serif;font-size:14px;font-weight:400;line-height:20px;text-align:center;color:#616161;">Update your <a href="https://chitralekha.ai4bharat.org/#/login" style="color: #AC7B4C; text-decoration: none;">email preferences</a> to choose the types of emails you receive, or you can <a href="https://backend.dev.chitralekha.ai4bharat.org/newsletter/unsubscribe?email={user_email_id}" id="unsubscribeLink" style="color: #AC7B4C; text-decoration: none;"> unsubscribe </a>from all future emails.</div>
<div style="font-family:Muli, Arial, sans-serif;font-size:14px;font-weight:400;line-height:20px;text-align:center;color:#616161;">Update your <a href="https://chitralekha.ai4bharat.org/#/login" style="color: #AC7B4C; text-decoration: none;">email preferences</a> to choose the types of emails you receive, or you can <a href="http://127.0.0.1:8000/newsletter/unsubscribe?email={user_email_id}" id="unsubscribeLink" style="color: #AC7B4C; text-decoration: none;"> unsubscribe </a>from all future emails.</div>
</td>
</tr>
</table>
Expand Down
21 changes: 21 additions & 0 deletions backend/newsletter/templates/unsubscribe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- popup_template.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Unsubscribed</title>
</head>
<body>

<!-- Your page content goes here -->

<script>
// JavaScript code to show a pop-up
window.onload = function() {
alert("Unsubscribed Successfully!");
};
</script>

</body>
</html>
6 changes: 2 additions & 4 deletions backend/newsletter/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from django.core.mail import send_mail
from django.conf import settings
import uuid
from django.shortcuts import render


@swagger_auto_schema(
Expand Down Expand Up @@ -64,10 +65,7 @@ def unsubscribe(request):
status=status.HTTP_400_BAD_REQUEST,
)
sub_user.delete()
return Response(
{"message": "Unsubscribed Successfully."},
status=status.HTTP_200_OK,
)
return render(request, 'unsubscribe.html')


class NewsletterViewSet(ModelViewSet):
Expand Down

0 comments on commit 3c848d3

Please sign in to comment.