OneSignal provides 3 ways to add email records into your account. If you have the email list already, you can take advantage of our CSV Import through our dashboard or API Import options. If you want to collect emails directly on your site or mobile app with the OneSignal SDK active, you can use SDK
Emails in OneSignal will have a separate device record Player ID than push notification subscribers. This is to manage cases of the user opting-out of one channel, you can still message them on the other. If you want to add emails to push records, you will need to do this as Data Tags.
Within Audience > All Users, you can import a CSV list of email addresses or add email addresses directly.
CSV Email Upload
- Must have
- Limited to UTF-8 Encoding
- Columns must be unique
- 10 columns max
Select Actions > Import/Update Users
SELECT CSV TO UPLOAD Make sure you have an
Click Actions > Manually Add Emails to open a new modal where you can add an individual user's email and tag data.
In addition to adding a user's email, you may also add Data Tags to the user record. The Manually Add Users modal supports adding up to 10 tags.
If the email address you enter is not found in your OneSignal user list, a new user will be created. However, if the email address is found, the user will be updated with any tags that you add here. If a user already has a tag with a particular key (e.g.
levels_completed), any value you add here will replace the value the user record previously had.
One of the benefits of using OneSignal for email is the ability to control both a user's push and email subscriptions together in one place. The code you should use depends on whether you store user emails alongside Player IDs or not. However, not all apps or sites store data this way, so we offer two ways to import emails.
If your app or website offers accounts that users log into, you are likely already storing email addresses alongside Player IDs. You may also have associated emails <-> Player IDs if you ask users for email addresses, or if you collect them through other means.
To import emails in this case, we recommend you update your Player ID records with email addresses, so that you do not create duplicate records. See the following for example code:
Some apps and sites do not store email addresses alongside Player IDs. We recommend associating these when possible, however this is unavoidable for some apps and sites based on how they collect emails.
Without association, you may have two unrelated user records (push and email), which can lead to sending redundant information to users, having extraneous records (e.g. if a user cancels their account or uninstalls your app), or just limiting your options for more advanced multi-channel marketing in the future.
To import emails in this case, you will need to create new records that have email addresses. See the following for example code:
Each OneSignal SDK has a
setEmail method. When the user provides this email, you can set it upon the user to create an Email Record which is different from the Push Record. Web push users must be subscribed before an email can be set. So if the user is not subscribed, you can capture that email and send with the API method above or add it directly.
Done! Once you've imported your emails, go back to Email Quickstart to determine if you have any steps left.
Updated 13 days ago