DoSomethingArchive / quicksilver-api

:postbox: API gateway to Quicksilver (Message Broker) functionality.
MIT License
0 stars 3 forks source link

Prepare password reset payload #73

Closed sergiitk closed 8 years ago

sergiitk commented 8 years ago

Build full reset password payload by merging data from POST, Northstar API and Phoenix API.

https://github.com/DoSomething/quicksilver-api/blob/master/documentation/messages/user.password_reset.transactional.md#current-message-payload

sergiitk commented 8 years ago

Example:

Serialised:

a:10:{s:8:"activity";s:13:"user_password";s:5:"email";s:20:"test@dosomething.org";s:3:"uid";s:3:"187";s:10:"merge_vars";a:3:{s:12:"MEMBER_COUNT";s:11:"3.5 million";s:5:"FNAME";s:4:"Test";s:10:"RESET_LINK";s:101:"http://dev.dosomething.org:8888/user/reset/187/1465242461/1JH-Cj1Lmgzkd9VpW4-ed_iaF_XH7LYBnVSKLkjrDBI";}s:12:"user_country";s:2:"US";s:13:"user_language";s:2:"en";s:14:"email_template";s:19:"mb-user-password-US";s:10:"email_tags";a:1:{i:0;s:20:"drupal_user_password";}s:18:"activity_timestamp";i:1465242461;s:14:"application_id";s:2:"US";}

Pretty print:

Array
(
    [activity] => user_password
    [email] => test@dosomething.org
    [uid] => 187
    [merge_vars] => Array
        (
            [MEMBER_COUNT] => 3.5 million
            [FNAME] => Test
            [RESET_LINK] => http://dev.dosomething.org:8888/user/reset/187/1465242461/1JH-Cj1Lmgzkd9VpW4-ed_iaF_XH7LYBnVSKLkjrDBI
        )

    [user_country] => US
    [user_language] => en
    [email_template] => mb-user-password-US
    [email_tags] => Array
        (
            [0] => drupal_user_password
        )

    [activity_timestamp] => 1465242461
    [application_id] => US
)

JSON:

{"activity":"user_password","email":"test@dosomething.org","uid":"187","merge_vars":{"MEMBER_COUNT":"3.5 million","FNAME":"Test","RESET_LINK":"http:\/\/dev.dosomething.org:8888\/user\/reset\/187\/1465242461\/1JH-Cj1Lmgzkd9VpW4-ed_iaF_XH7LYBnVSKLkjrDBI"},"user_country":"US","user_language":"en","email_template":"mb-user-password-US","email_tags":["drupal_user_password"],"activity_timestamp":1465242461,"application_id":"US"}

Pretty print JSON:

{
    "activity": "user_password",
    "email": "test@dosomething.org",
    "uid": "187",
    "merge_vars": {
        "MEMBER_COUNT": "3.5 million",
        "FNAME": "Test",
        "RESET_LINK": "http://dev.dosomething.org:8888/user/reset/187/1465242461/1JH-Cj1Lmgzkd9VpW4-ed_iaF_XH7LYBnVSKLkjrDBI"
    },
    "user_country": "US",
    "user_language": "en",
    "email_template": "mb-user-password-US",
    "email_tags": [
        "drupal_user_password"
    ],
    "activity_timestamp": 1465242461,
    "application_id": "US"
}