Python Forum

Full Version: sending email from admin to user in django
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i want to send email from admin to user .my code get no reverse match error.

def emails(request,id):
subject = 'leave confirmation'
message = ' your leav application approved'
email_from = settings.EMAIL_HOST_USER
for i in x:
recipient_list = [,]
send_mail( subject, message, email_from,recipient_list)
return HttpResponse("send")

<a href="{% url 'emails' %} ">send mail</a>
class ButtonWidget(forms.Widget):
template_name = 'auth_button_widget.html'
def renders(self, name, value, attrs=None):
context = {
'url': '/',

return mark_safe(render_to_string(self.template_name, context))

class leavapprv(forms.ModelForm):
button = forms.CharField(widget=ButtonWidget)

class Meta:
model = leavdb11
fields = "__all__"