# Aggiornare le preferenze email tramite API

**URL:** <https://meta.discourse.org/t/updating-email-preferences-via-api/65983>\
**Category:** Product Support\
**Created:** [11 Luglio 2017, 5:10am UTC](https://meta.discourse.org/t/updating-email-preferences-via-api/65983 "2017-07-11T05:10:28Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![kgoetz](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kgoetz](https://meta.discourse.org/u/kgoetz)\
**Post date:** [11 Luglio 2017, 5:10am UTC](https://meta.discourse.org/t/updating-email-preferences-via-api/65983/1 "2017-07-11T05:10:28Z")

</div>

Hi,  
I’ve spent several hours trying to update users email preferences via the api, and haven’t had much luck. Specifically, I want to enable Activity Summary and turn of Mailing list mode.

Has anyone done this and succeeded and can point me at where I’ve gone wrong?

Some examples below.

I tried this with and without the user/user option layers. Unfortunately there isn’t a meaningful error, just a page of html spat out.

> $ curl -X POST --data ‘user: { user\_option: {“mailing\_list\_mode\_frequency”: 1, “email\_direct”: True, “mailing\_list\_mode”: False, “email\_digests”: True, “email\_in\_reply\_to”: True, “enable\_quoting”: True, “like\_notification\_frequency”: 1, “email\_always”: True, “email\_private\_messages”: True, “email\_previous\_replies”: 1, “include\_tl0\_in\_digests”: True}}}’ “[https://discuss.example.com/users/karl\_goetz?api\_key=[..]&api\_username=karl\_goetz](https://discuss.example.com/users/karl_goetz?api_key=%5B..%5D&api_username=karl_goetz)”
> 
> Forums

Using pydiscuourse (installed from pip), has also failed. Some examples of me finding with the options:

> discourse\_client.set\_preference(mailing\_list\_mode=False, email\_digests=True, email\_direct=True, email\_in\_reply\_to=True, email\_private\_messages=True, digest\_after\_minutes=1440, include\_tl0\_in\_digests=True)

> discourse\_client.set\_preference(‘karl\_goetz’, email\_always=True, mailing\_list\_mode=False, email\_digests=True, email\_direct=True, email\_in\_reply\_to=False, email\_private\_messages=True, email\_previous\_replies=1, digest\_after\_minutes=1440, include\_tl0\_in\_digests=True)

I can change my user preferences via chrome at [example.com/u/karl\_goetz/preferences/emails](http://example.com/u/karl_goetz/preferences/emails) so _that_ bit works and if nothing else I’ll try pushing data in through that route.

---

_[View the full topic](https://meta.discourse.org/t/updating-email-preferences-via-api/65983)._
