Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subscription created_at, updated_at when listing subscribers list #1018

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

r0ro
Copy link
Contributor

@r0ro r0ro commented Nov 9, 2022

Right now the api returns subscribers list subscription with 'updated_at', 'created_at' values from the list itself.

When trying to synchronise subscription status with an external system, accessing subscription 'updated_at', 'created_at' values might be useful as well.

This commit is adding subscription_created_at, subscription_updated_at attributes to list information:

{
	"id": 1,
	"created_at": "2022-11-08T23:02:38.187513Z",
	"updated_at": "2022-11-08T23:02:38.187513Z",
	"uuid": "0e4106c8-707d-4f34-b719-d28114ccd49f",
	"email": "[email protected]",
	"name": "John Doe",
	"attribs": {
		"city": "Bengaluru",
		"good": true,
		"type": "known"
	},
	"status": "enabled",
	"lists": [
            {
		"subscription_status": "unsubscribed",
		"subscription_created_at": "2022-11-08T23:02:38.187513+00:00",  /* NEW */
		"subscription_updated_at": "2022-11-08T23:27:01.351319+00:00",  /* NEW */
		"id": 1,
		"uuid": "db41ca4e-a460-49b6-9b82-517bce96c378",
		"name": "Default list",
		"type": "private",
		"optin": "single",
		"tags": [
			"test"
		],
		"description": "",
		"created_at": "2022-11-08T23:02:38.183927+00:00",
		"updated_at": "2022-11-08T23:02:38.183927+00:00"
	    }
        ]
}

Right now the api returns subscribers list subscription with 'updated_at', 'created_at' values
from the list itself.
When trying to synchronise subscription status with an external system, accessing subscription
'updated_at', 'created_at' values might be useful as well.
This commit is adding subscription_created_at, subscription_updated_at attributes to list information:

```json
{
	"id": 1,
	"created_at": "2022-11-08T23:02:38.187513Z",
	"updated_at": "2022-11-08T23:02:38.187513Z",
	"uuid": "0e4106c8-707d-4f34-b719-d28114ccd49f",
	"email": "[email protected]",
	"name": "John Doe",
	"attribs": {
		"city": "Bengaluru",
		"good": true,
		"type": "known"
	},
	"status": "enabled",
	"lists": [
            {
		"subscription_status": "unsubscribed",
		"subscription_created_at": "2022-11-08T23:02:38.187513+00:00",  /* NEW */
		"subscription_updated_at": "2022-11-08T23:27:01.351319+00:00",  /* NEW */
		"id": 1,
		"uuid": "db41ca4e-a460-49b6-9b82-517bce96c378",
		"name": "Default list",
		"type": "private",
		"optin": "single",
		"tags": [
			"test"
		],
		"description": "",
		"created_at": "2022-11-08T23:02:38.183927+00:00",
		"updated_at": "2022-11-08T23:02:38.183927+00:00"
	    }
        ]
}
```
@r0ro
Copy link
Contributor Author

r0ro commented Nov 9, 2022

Please be forgiving, I'm not really familiar with go, so it might not be the best way to achieve what I'm trying to do

@knadh knadh added the enhancement New feature or request label Nov 9, 2022
@knadh knadh merged commit 6d3ae4c into knadh:master Nov 9, 2022
@knadh
Copy link
Owner

knadh commented Nov 9, 2022

@r0ro this is perfect. Thanks!

@r0ro r0ro deleted the list_subscription_date branch November 9, 2022 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants