Compare commits

...

7 Commits

Author SHA1 Message Date
Anand Chitipothu
8a3e31f021 fix: only show the published courses on All Courses page
Closes #155
2021-07-19 17:03:38 +05:30
Jannat Patel
9be8a1af0b Merge pull request #154 from fossunited/fix-invite-email
Fix invite email
2021-07-19 13:43:36 +05:30
Anand Chitipothu
b9cac20613 fix: the delay in sending signup email 2021-07-19 13:32:18 +05:30
Anand Chitipothu
e6d5e6d37b fix: "Hello None" in the signup email
We were trying to show the full_name, but invite request only knows the email.
2021-07-19 13:31:44 +05:30
Jannat Patel
0abfcac7da Merge pull request #153 from fossunited/improve-email-templates
fix: fixed the email message sent out on signup
2021-07-19 13:23:55 +05:30
Anand Chitipothu
b70e8b9acc fix: fixed the email message sent out on signup
Currently updated keeping Mon.School in mind.
2021-07-19 13:14:13 +05:30
Jannat Patel
3b1e1aa3c3 Merge pull request #152 from fossunited/cleanup
fix: Cleanup
2021-07-19 12:49:22 +05:30
3 changed files with 13 additions and 10 deletions

View File

@@ -30,10 +30,13 @@ class InviteRequest(Document):
return user return user
def send_email(self): def send_email(self):
subject = _("Your request has been approved.") site_name = "Mon.School"
subject = _("Welcome to {0}!").format(site_name)
args = { args = {
"full_name": self.full_name, "full_name": self.full_name,
"signup_form_link": "/new-sign-up?invite_code={0}".format(self.name), "signup_form_link": "/new-sign-up?invite_code={0}".format(self.name),
"site_name": site_name,
"site_url": frappe.utils.get_url() "site_url": frappe.utils.get_url()
} }
frappe.sendmail( frappe.sendmail(
@@ -42,7 +45,8 @@ class InviteRequest(Document):
subject=subject, subject=subject,
header=[subject, "green"], header=[subject, "green"],
template = "lms_invite_request_approved", template = "lms_invite_request_approved",
args=args) args=args,
now=True)
@frappe.whitelist(allow_guest=True) @frappe.whitelist(allow_guest=True)
def create_invite_request(invite_email): def create_invite_request(invite_email):

View File

@@ -1,9 +1,8 @@
<div> <div>
{% set site_link = "<a href='" + site_url + "'>" + site_url + "</a>" %} {% set site_link = "<a href='" + site_url + "'>" + site_name + "</a>" %}
<p>{{_("Dear Community Member,")}}</p> <p>{{_("Hi,")}}</p>
<p>{{_("Your Invite Request to be a part of {0} has <p>{{_("Welcome to {0}!").format(site_name)}}</p>
been approved.").format(site_link)}}</p> <p>Click on the link below to complete your sign up and set a new password</p>
<p>Click on the link below to complete your Sign up and set a new password</p>
<p style="margin: 15px 0px;"> <p style="margin: 15px 0px;">
<a href="{{ signup_form_link }}" rel="nofollow" class="btn btn-primary">{{ _("Complete Sign Up") }}</a> <a href="{{ signup_form_link }}" rel="nofollow" class="btn btn-primary">{{ _("Complete Sign Up") }}</a>
</p> </p>
@@ -14,5 +13,5 @@
</p> </p>
<br> <br>
<p>Thanks and Regards,</p> <p>Thanks and Regards,</p>
<p>Your Community.</p> <p>{{site_name}}</p>
</div> </div>

View File

@@ -5,7 +5,7 @@ def get_context(context):
context.courses = get_courses() context.courses = get_courses()
def get_courses(): def get_courses():
course_names = frappe.get_all("LMS Course", pluck="name") course_names = frappe.get_all("LMS Course", filters={"is_published": True}, pluck="name")
courses = [] courses = []
for course in course_names: for course in course_names:
courses.append(frappe.get_doc("LMS Course", course)) courses.append(frappe.get_doc("LMS Course", course))