Skip to content

Commit

Permalink
home: dashboard: mail_template: Fix links for prod
Browse files Browse the repository at this point in the history
Signed-off-by: Shashank Verma <[email protected]>
  • Loading branch information
shank03 committed Oct 5, 2023
1 parent f457f9c commit b30e43e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
'user': email_context.user.username,
'url': email_context.url,
'protocol': ,
'host': request.get_host()
'host': email_context.host
}
{% endcomment %}
{% autoescape off %}
<br>
Hi there! <b>{{ mentor }}</b>,<br><br>

PFB the details of the issue requested for assignment.<br><br>
<b>Your Profile:</b> {{ protocol }}://{{ host }}/profile/user/{{ mentor }} <br> <br>
<b>Requester's Profile:</b> {{ protocol }}://{{ host }}/profile/user/{{ user }} <br> <br>
<b>Your Profile:</b> {{ protocol }}://{{ host }}profile/user/{{ mentor }} <br> <br>
<b>Requester's Profile:</b> {{ protocol }}://{{ host }}profile/user/{{ user }} <br> <br>
<b>See Issue on Github:</b> {{ url }} <br><br>

If clicking on any of the link above doesn't work, please copy and paste the URL in a new browser
Expand Down
6 changes: 3 additions & 3 deletions home/templates/dashboard/mail_template_submit_pr_request.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
'user': email_context.user.username,
'url': url,
'protocol': ,
'host': request.get_host()
'host': email_context.host
}
{% endcomment %}
{% autoescape off %}
<br>
Hi there! <b>{{ mentor }}</b>,<br><br>

{{ user }} has requested for approval of the PR on a issue that you are mentoring.<br><br>
<b>Your Profile:</b> {{ protocol }}://{{ host }}/profile/user/{{ mentor }} <br> <br>
<b>Contributor's Profile:</b> {{ protocol }}://{{ host }}/profile/user/{{ user }} <br> <br>
<b>Your Profile:</b> {{ protocol }}://{{ host }}profile/user/{{ mentor }} <br> <br>
<b>Contributor's Profile:</b> {{ protocol }}://{{ host }}profile/user/{{ user }} <br> <br>
<b>See PR on Github:</b> {{ url }} <br><br>

If clicking on any of the link above doesn't work, please copy and paste the URL in a new browser
Expand Down
6 changes: 4 additions & 2 deletions home/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import decouple

from django.shortcuts import render, HttpResponseRedirect, reverse, HttpResponse, redirect
from django.core.mail import send_mail, BadHeaderError

Expand Down Expand Up @@ -122,7 +124,7 @@ def request_issue_assignment(request, issue_pk):
'user': requester,
'url': issue.html_url,
'protocol': request.build_absolute_uri().split('://')[0],
'host': request.get_host(),
'host': request.get_host() + '/' + decouple.config('BASE_URL', default=''),
'subject': "Request for Issue Assignment under ContriHUB-22.",
'issue': issue,
'action': '',
Expand Down Expand Up @@ -209,7 +211,7 @@ def submit_pr_request(request, active_issue_pk):
'user': contributor,
'url': pr.pr_link,
'protocol': request.build_absolute_uri().split('://')[0],
'host': request.get_host(),
'host': request.get_host() + '/' + decouple.config('BASE_URL', default=''),
'issue': issue,
'action': '',
'subject': "Request for Approval of PR on an issue under ContriHUB-22.",
Expand Down

0 comments on commit b30e43e

Please sign in to comment.