Updates the raw content of an in-transit email message, in MIME format.
This example describes how to update in-transit email message. For more information and examples for using this API, see Updating message content with AWS Lambda.
Updates to an in-transit message only appear when you call PutRawMessageContent from an AWS Lambda function configured with a synchronous Run Lambda rule. If you call PutRawMessageContent on a delivered or sent message, the message remains unchanged, even though GetRawMessageContent returns an updated message.
Parameters:
-
message_id
(messageIdType)
–
The identifier of the email message being updated.
-
content
(RawMessageContent)
–
Describes the raw message content of the updated email message.
Raises:
-
InvalidContentLocation
–
WorkMail could not access the updated email content. Possible reasons:
-
You made the request in a region other than your S3 bucket region.
-
The S3 bucket owner is not the same as the calling AWS account.
-
You have an incomplete or missing S3 bucket policy. For more information about policies, see Updating message content with AWS Lambda in the WorkMail Administrator Guide.
-
MessageFrozen
–
The requested email is not eligible for update. This is usually the case for a redirected email.
-
MessageRejected
–
The requested email could not be updated due to an error in the MIME content. Check the error message for more information about what caused the error.
-
ResourceNotFoundException
–
The requested email message is not found.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_workmailmessageflow/_services/async_work_mail_message_flow.py
| async def put_raw_message_content(
self,
message_id: "capo_workmailmessageflow.types.message_id_type.messageIdType",
content: "capo_workmailmessageflow.types.raw_message_content.RawMessageContent",
*,
config_overrides: Optional[AsyncWorkMailMessageFlowClientConfig] = None,
) -> "capo_workmailmessageflow.types.put_raw_message_content_response.PutRawMessageContentResponse":
"""<p>Updates the raw content of an in-transit email message, in MIME format.</p> <p>This example describes how to update in-transit email message. For more information and examples for using this API, see <a href="https://docs.aws.amazon.com/workmail/latest/adminguide/update-with-lambda.html"> Updating message content with AWS Lambda</a>.</p> <note> <p>Updates to an in-transit message only appear when you call <code>PutRawMessageContent</code> from an AWS Lambda function configured with a synchronous <a href="https://docs.aws.amazon.com/workmail/latest/adminguide/lambda.html#synchronous-rules"> Run Lambda</a> rule. If you call <code>PutRawMessageContent</code> on a delivered or sent message, the message remains unchanged, even though <a href="https://docs.aws.amazon.com/workmail/latest/APIReference/API_messageflow_GetRawMessageContent.html">GetRawMessageContent</a> returns an updated message. </p> </note>
Args:
message_id: <p>The identifier of the email message being updated.</p>
content: <p>Describes the raw message content of the updated email message.</p>
Raises:
capo_workmailmessageflow.errors.invalid_content_location.InvalidContentLocation: <p>WorkMail could not access the updated email content. Possible reasons:</p> <ul> <li> <p>You made the request in a region other than your S3 bucket region.</p> </li> <li> <p>The <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-owner-condition.html">S3 bucket owner</a> is not the same as the calling AWS account.</p> </li> <li> <p>You have an incomplete or missing S3 bucket policy. For more information about policies, see <a href="https://docs.aws.amazon.com/workmail/latest/adminguide/update-with-lambda.html"> Updating message content with AWS Lambda </a> in the <i>WorkMail Administrator Guide</i>.</p> </li> </ul>
capo_workmailmessageflow.errors.message_frozen.MessageFrozen: <p>The requested email is not eligible for update. This is usually the case for a redirected email.</p>
capo_workmailmessageflow.errors.message_rejected.MessageRejected: <p>The requested email could not be updated due to an error in the MIME content. Check the error message for more information about what caused the error.</p>
capo_workmailmessageflow.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested email message is not found.</p>
capo_workmailmessageflow.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_workmailmessageflow.types.put_raw_message_content_request.PutRawMessageContentRequest]",
) -> AsyncOperationResponse[
"capo_workmailmessageflow.types.put_raw_message_content_response.PutRawMessageContentResponse"
]:
import capo_workmailmessageflow._operations.giraffe_message_in_transit_service.put_raw_message_content
(
output,
http_response,
) = await capo_workmailmessageflow._operations.giraffe_message_in_transit_service.put_raw_message_content.async_put_raw_message_content(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutRawMessageContent")
)
input_: capo_workmailmessageflow.types.put_raw_message_content_request.PutRawMessageContentRequest = {
"message_id": message_id,
"content": content,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|