You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
withAddress(@NotNull String oneOrMoreAddresses) is misleading #702
Thanks for reporting this, @sysmat. You're right that RecipientBuilder.withAddress(String oneOrMoreAddresses) is misleading: a RecipientBuilder builds one recipient, and this method accepts one address. I'll patch the implementation's parameter and validation name to address.
The missing .to(...) overload is intentional since 9.0.0: recipients are now constructed explicitly with RecipientBuilder / RecipientsBuilder and added through withRecipients(...), so each recipient carries its TO, CC, or BCC type. The migration guide mentions that change, but the single-address versus delimited-list distinction is not prominent enough. I'll improve the website examples accordingly.
Released in 9.3.2. I updated RecipientBuilder's implementation parameter and validation label to address, and I clarified the API usage examples and 9.0 migration guide for the one-recipient and delimited-list cases. Thanks again for the report.
I get it, I feel the same, but it was becoming unmaintainable. More and more options (last time S/MIME certs per recipient) resulted in another explosion of overloads and that three times, for the TO, CC and BCC convenience methods, on top of the more generic ones.
Something had to give. So I just followed through on the fluent builder api that was already part of the library's DNA, in the EmailBuilder and MailerBuilder api's. And now the RecipientBuilder and RecipientsBuilder.
Now, if there ever are new recipient specific things we want to add, it's just a matter of adding a single field to the builders.
A small follow-up for you and anyone finding this later: you made a fair point and it's was something that kept bugging me as well. In 10.0.0, the compact API is making a small comeback in #705 with the three conveniences people use most:
This strikes a better balance. The common name-and-address case reads nicely again, while advanced cases still use the full RecipientBuilder. That leaves room for recipient-specific options without bringing back every old overload.
Activity
bbottema commentedon Aug 14, 2026
Thanks for reporting this, @sysmat. You're right that
RecipientBuilder.withAddress(String oneOrMoreAddresses)is misleading: aRecipientBuilderbuilds one recipient, and this method accepts one address. I'll patch the implementation's parameter and validation name toaddress.The missing
.to(...)overload is intentional since 9.0.0: recipients are now constructed explicitly withRecipientBuilder/RecipientsBuilderand added throughwithRecipients(...), so each recipient carries its TO, CC, or BCC type. The migration guide mentions that change, but the single-address versus delimited-list distinction is not prominent enough. I'll improve the website examples accordingly.fix(recipients): clarify single-address parameter (#702)
bbottema commentedon Aug 14, 2026
Released in 9.3.2. I updated
RecipientBuilder's implementation parameter and validation label toaddress, and I clarified the API usage examples and 9.0 migration guide for the one-recipient and delimited-list cases. Thanks again for the report.sysmat commentedon Aug 14, 2026
I like previous API surface much more
bbottema commentedon Aug 14, 2026
I get it, I feel the same, but it was becoming unmaintainable. More and more options (last time S/MIME certs per recipient) resulted in another explosion of overloads and that three times, for the TO, CC and BCC convenience methods, on top of the more generic ones.
Something had to give. So I just followed through on the fluent builder api that was already part of the library's DNA, in the EmailBuilder and MailerBuilder api's. And now the RecipientBuilder and RecipientsBuilder.
Now, if there ever are new recipient specific things we want to add, it's just a matter of adding a single field to the builders.
sysmat commentedon Aug 14, 2026
I understand to lower a surface area of API
bbottema commentedon Aug 18, 2026
A small follow-up for you and anyone finding this later: you made a fair point and it's was something that kept bugging me as well. In 10.0.0, the compact API is making a small comeback in #705 with the three conveniences people use most:
This strikes a better balance. The common name-and-address case reads nicely again, while advanced cases still use the full
RecipientBuilder. That leaves room for recipient-specific options without bringing back every old overload.sysmat commentedon Aug 19, 2026
@bbottema I was thinking the same way, great news