Skip to content

SES SendRawEmailCommand - TS2322: Type 'string' is not assignable to type 'Uint8Array'. #4761

Discussion options

You must be logged in to vote

Hi @mikelhamer, sorry for the confusion. Basically, the documentation says in a string which one is the type of data expected for each parameter, which in this case is "BLOB_VALUE" and not "STRING_VALUE". I know this can cause confusion sometimes and therefore I will pass this feedback to the documentation team. To address your specific need right now, the type of data for "Data" in JS is Uint8Array, which can be also confirmed here.

To create a Uint8Array from a string you can use the TextEncoder API as follow:

const encoder = new TextEncoder();
const uintArrayValue = encoder.encode("Here is the message you want to send");

I hope this helps!

Thanks!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by yenfryherrerafeliz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants