models/senderdb.py¶
models.senderdb ¶
Sender DB
SenderCampaignDB ¶
Bases: DBBase
SenderCampaign Collection
Source code in models/senderdb.py
add ¶
new
staticmethod
¶
new a default struct
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Campaign name. |
required |
pid |
str
|
Project id. |
required |
tid |
str
|
Team id. |
required |
uid |
str
|
User id. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Return a default struct. |
Struct
_id
: Unique id, orcid
.name
: Campaign name.created
:pid
: Project id.tid
: Team id.uid
: User id.at
: Created at.
-
receiver
:teams
: List of team id(tid
)users
: List of user id(`uid)team_w_tags
: List of the tag id created by team.all_users
:bool
Is send to all platform's users.
-
mail
:subject
: Subject.content
: Content, and Markdown format supported.
TODO
Need refactor in pydantic.
Source code in models/senderdb.py
SenderLogsDB ¶
Bases: DBBase
SenderLogsDB Collection
Source code in models/senderdb.py
add ¶
Save log
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cid |
str
|
Campaign id, the |
required |
layout |
str
|
In |
required |
desc |
str
|
Description. |
required |
receivers |
list
|
List of user info or replace data. Required fields in |
required |
Source code in models/senderdb.py
SenderReceiverDB ¶
Bases: DBBase
SenderReceiver Collection
For User to upload the list of receivers in CSV.
Source code in models/senderdb.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
index ¶
new
staticmethod
¶
new a struct
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pid |
str
|
Project id. |
required |
cid |
str
|
Campaign id, the |
required |
mail |
str
|
User's mail. |
required |
name |
str
|
User name. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Return a default struct. |
Struct
_id
: Random id inObjectID
.cid
: Campaign idpid
: Project iddata
:dict
mail
: User mail.name
: User name....
: (... and any other fields.)
TODO
Need refactor in pydantic.
Source code in models/senderdb.py
remove_past ¶
Remove past data
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pid |
str
|
Project id. |
required |
cid |
str
|
Campaign id, the |
required |
Source code in models/senderdb.py
update_data ¶
Update datas
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pid |
str
|
Project id. |
required |
cid |
str
|
Campaign id, the |
required |
datas |
list
|
List of data to inserted / updated. Must have |
required |
Source code in models/senderdb.py
SenderSESLogsDB ¶
Bases: DBBase
SenderSESLogsDB Collection
Source code in models/senderdb.py
add ¶
Save log
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cid |
str
|
Campaign id, the |
required |
mail |
str
|
User mail. |
required |
name |
str
|
User name. |
required |
ses_result |
str
|
The result from the return of SES.Client.send_email / SES.Client.send_raw_email. |
required |