Thanks,
I am trying to send email to the users that their email address is stored
in the database on the auth_user table. can someone please point me to the
right direction.

Cheers,


On Thu, Jan 22, 2015 at 3:03 PM, Collin Anderson <cmawebs...@gmail.com>
wrote:

> Hi,
>
> Yes, this is possible. Something like:
>
> from django.core.mail import send_mail
>
> def authorized_leave(request):
>     form = MyForm()
>     if request.method == 'POST':
>         form = MyForm(request.POST)
>         if form.is_valid():
>             obj = form.save()
>             send_mail('Subject here', 'Here is the message.', '
> f...@example.com', ['t...@example.com'])
>             return redirect('/done/')
>     return render(request, 'template.html', {form: 'form'})
>
> Collin
>
>
> On Monday, January 19, 2015 at 10:02:45 PM UTC-5, suabiut wrote:
>>
>> Hi,
>> I am trying to send an email to several users once a form is submit. I
>> have done the view.py to update the database once the form is submitted and
>> is working fine. what i want to accomplish when the form is submitted is to
>> update the database and at the same time send out email when a user click
>> on the Authorized leave button.
>>
>> here is the step i want to do:
>>
>>  [image: Inline image 1]
>>
>> 1) user click on the check box and this form below appears
>>
>>
>> [image: Inline image 2]
>>  2) the user then fill up the form and click on authorized leave button.
>> the form will stored the information into the database. which i have
>> already done it. what i wanted to do next is to also send a emails when the
>> authorized leave button is click. is it possible to send emails and also
>> save data to database when the authorized leave button is click. i want to
>> send email to the *Test User* which have his email address store in the
>> database.
>>
>> template.html
>> <form action ="" method="post">{%csrf_token%}
>> <table>
>> {{form.as_table}}
>> </table>
>> <br>
>> <input type="submit" name="submit" value="Authorized Leave" >
>>
>>
>> </form>
>>
>> please point me to the right direction.
>>
>> Cheers,
>>
>>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3df19a0c-2afc-4e17-b527-83d38a639611%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3df19a0c-2afc-4e17-b527-83d38a639611%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCf-y4fu-Znpem4qJrU8iSh8jeaWNSEa9VfHzn0_fxPfG1wfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to