comparison src/api/change_email_2.json.luan @ 59:02d8876dc41d

improve change email
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 29 Nov 2022 18:45:22 -0700
parents 31c895b73bd0
children
comparison
equal deleted inserted replaced
58:31c895b73bd0 59:02d8876dc41d
12 12
13 13
14 return api(function() 14 return api(function()
15 local base_url = Http.request.parameters.base_url or user_error "missing base_url param" 15 local base_url = Http.request.parameters.base_url or user_error "missing base_url param"
16 local from = Http.request.parameters.from or user_error "missing from param" 16 local from = Http.request.parameters.from or user_error "missing from param"
17 local email = Http.request.parameters.email or user_error "missing email param" 17 local to = Http.request.parameters.to or user_error "missing to param"
18 local password = Http.request.parameters.password or user_error "missing password param" 18 local password = Http.request.parameters.password or user_error "missing password param"
19 local mailer = Mail.sender() or user_error "mail not configured" 19 local mailer = Mail.sender() or user_error "mail not configured"
20 mailer.send{ 20 mailer.send{
21 From = from 21 From = from
22 To = email 22 To = to
23 Subject = "Change Email" 23 Subject = "Change Email"
24 body = output_of(function() %> 24 body = output_of(function() %>
25 Change your email address to this email by clicking this link: 25 Change your email address to this email by clicking this link:
26 26
27 <%=base_url%>/change_email.html?email=<%=url_encode(email)%>&password2=<%=password%> 27 <%=base_url%>/change_email.html?password=<%=password%>
28 <% end) 28 <% end)
29 } 29 }
30 return { 30 return {
31 okay = true 31 okay = true
32 } 32 }