Skip to content

Commit d9e4fbf

Browse files
author
Jade Westover
committed
Merge branch 'main' of ../ruby-library-dev
2 parents 04e2240 + d70d7b7 commit d9e4fbf

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

docs/email.rst

+30-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ Update Email Channel
6666
email_channel.channel_id = '01234567-890a-bcde-f012-3456789abc0'
6767
email_channel.type = 'email'
6868
email_channel.commercial_opted_in = '2018-10-28T10:34:22'
69-
email_channel.address = '[email protected]'
7069
email_channel.timezone = 'America/Los_Angeles'
7170
email_channel.locale_country = 'US'
7271
email_channel.locale_language = 'en'
@@ -75,7 +74,36 @@ Update Email Channel
7574
.. note::
7675

7776
The only thing required to make a request is the channel_id. However, anything
78-
that needs to be updated must also be included.
77+
that needs to be updated must also be included. Please note that you cannot
78+
update an email address with this method. Please use the replace method instead.
79+
80+
Replace Email Channel
81+
--------------------
82+
83+
.. code-block:: ruby
84+
85+
require 'urbanairship'
86+
UA = Urbanairship
87+
airship = UA::Client.new(key:'application_key', secret:'master_secret')
88+
email_channel = UA::Email.new(client: airship)
89+
email_channel.channel_id = '01234567-890a-bcde-f012-3456789abc0'
90+
email_channel.address = '[email protected]'
91+
email_channel.type = 'email'
92+
email_channel.commercial_opted_in = '2018-10-28T10:34:22'
93+
email_channel.timezone = 'America/Los_Angeles'
94+
email_channel.locale_country = 'US'
95+
email_channel.locale_language = 'en'
96+
email_channel.update
97+
98+
.. note::
99+
100+
This will replace an existing email channel and will do the following actions:
101+
102+
- Register a new channel
103+
- Associate the new email channel with the same user as the source channel
104+
- Uninstall the source channel
105+
106+
Address, Channel ID and type are all required parameters for this method.
79107

80108
Email Tags
81109
----------

0 commit comments

Comments
 (0)