Skip to content

Getting "json: cannot unmarshal string into Go struct field EmailConn.toaddr of type []string" #464

Closed Answered by pashagolub
ashx1901 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,

thanks a lot for your interest. The thing is toaddr can hold several recipients. That's why it should be an array, e.g.

timetable=> insert into timetable.parameter(task_id, order_id , value)
timetable-> VALUES (8,10,
timetable(> '{
timetable'> "username": "10.0.15.5",
timetable'> "serverhost": "mail.abc.com",
timetable'> "serverport": 25,
timetable'> "toaddr": ["rocky@abc.com", "John Doe <john.doe@email.com>"],
timetable'> "subject": "pg_timetable - No Reply"
timetable'> }'::jsonb);

more details: https://pg-timetable.readthedocs.io/en/master/components.html#parameter-value-format

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ashx1901
Comment options

@pashagolub
Comment options

@ashx1901
Comment options

@pashagolub
Comment options

@ashx1901
Comment options

Answer selected by pashagolub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
❓ question Further information is requested
2 participants