listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

Support merging attributes during import

Open tamalsaha opened this issue 3 years ago • 4 comments

It will be great if the attributes could be merged by default instead of ignoring or overwriting. https://pkg.go.dev/github.com/imdario/mergo could be handy library to implement such feature. But I see that this is done at the sql level. So, I am not sure what is the best way to do this.

tamalsaha avatar Apr 17 '21 19:04 tamalsaha

It's possible to do it in SQL with the || notation: attribs || $1. However, this'll need changes on the UI to give an option to merge.

knadh avatar Apr 21 '21 10:04 knadh

Is this still on the roadmap? Or otherwise said, is there anything that can be done to support?

Libermentix avatar Jan 21 '22 10:01 Libermentix

Hi @Libermentix. I haven't had a chance to look at this yet, but I'll try to look at this soon. If you are able to propose a PR in the meanwhile, that's welcome.

knadh avatar Jan 21 '22 11:01 knadh

Just to confirm, this is the reason a POST /api/subscribers/ to an existing email address seems to update name, email, lists, but will not update attribs? I wasn't expecting that, but I can simply query for the email address first and do a PUT instead.

devinellis avatar Jan 25 '22 20:01 devinellis