Open KJambo opened 6 days ago
It seems that the method at file_utils.rb#L90 changes the attachment handling between JSON and form-based approaches depending on the attachment size. As a result, the way content_id
is referenced also changes. This behavior seems inconsistent and might be a bug
Currently, the Nylas Ruby SDK does not allow users to set a custom
content_id
for attachments when sending emails asmultipart/form-data
. This limitation makes it difficult to use inline attachments, such as embedding images directly in the email body (e.g.,<img src="cid:custom_content_id" />
).In the current implementation, the SDK automatically assigns attachment names like
file0
,file1
, etc., when constructing the form request(source). While these names are internally treated ascontent_id
by the Nylas API and can technically be used (e.g.,<img src="cid:file0" />
), users have no control over these identifiers. This lack of customization limits the flexibility and usability of inline attachments.I would like the SDK to support user-defined
content_id
for attachments. Specifically:content_id
for each attachment when constructing the email.content_id
in place of the default names (file0, file1, etc.).content_id
is provided, fallback to the current behavior to ensure backward compatibility.