module/awsses.py¶
module.awsses ¶
AWS SDK API Integration
Integration S3.client
, SES.client
AWSS3 ¶
AWSS3
Parameters:
Name | Type | Description | Default |
---|---|---|---|
aws_access_key_id |
str
|
aws_access_key_id. |
required |
aws_secret_access_key |
str
|
aws_secret_access_key. |
required |
bucket |
str
|
bucket name. |
required |
Source code in module/awsses.py
convert_to_attachment ¶
Convert the object to match attachment
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
Object key. |
required |
Returns:
Type | Description |
---|---|
MIMEBase
|
Get the object and turn into attachment format to use. |
Source code in module/awsses.py
get_object ¶
Get object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
Object key. |
required |
Returns:
Type | Description |
---|---|
Any
|
Return the object. -> S3.Client.get_object |
AWSSES ¶
AWSSES
Parameters:
Name | Type | Description | Default |
---|---|---|---|
aws_access_key_id |
str
|
aws_access_key_id. |
required |
aws_secret_access_key |
str
|
aws_secret_access_key. |
required |
source |
dict
|
|
required |
Source code in module/awsses.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 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 |
|
format_mail
staticmethod
¶
raw_mail ¶
To make raw mail content
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs |
Any
|
|
{}
|
Returns:
Type | Description |
---|---|
Any
|
Tips
This function return the mail object, the next step is using module.awsses.AWSSES.send_raw_email to send.
Source code in module/awsses.py
send_email ¶
send_raw_email ¶
send raw email
If the data
has generated by module.awsses.AWSSES.raw_mail,
directly put into data
.
If the data
is empty, the attributes are the same
with module.awsses.AWSSES.raw_mail.
What is the difference between data
, data_str
. The data
is the
type of email.mime.multipart.MIMEMultipart, the data_str
is the
type of email.message.Message.as_string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs |
Any
|
The same with module.awsses.AWSSES.raw_mail. |
{}
|
Returns:
Type | Description |
---|---|
Any
|
dict |