Skip to content

fetchMyContacts ​

This method provides a list of contact objects identifying all users who previously granted authorization to send them email messages. Each contact contains the contact's ETH address as well as the ETH address for the protectedData containing their email address.

Usage ​

ts
const 
contactsList
= await
web3mail
.
fetchMyContacts
();

Parameters ​

ts
import { type 
FetchMyContactsParams
} from '@iexec/web3mail';

isUserStrict Optional ​

Type: boolean

This parameter enables fetching contacts who granted access exclusively to the user and no one else.

TIP

When you grant access to someone, you can choose to grant access to a specific user (a wallet) or to any user (0x0000000000000000000000000000000000000000).

ts
const 
contactsList
= await
web3mail
.
fetchMyContacts
({
isUserStrict
: true,
});

bulkOnly Optional ​

Type: boolean

Default: false

When set to true, this parameter filters contacts to only return those who have granted access with bulk processing capability. These contacts can be used with prepareEmailCampaign and sendEmailCampaign for bulk campaigns.

WARNING

To enable bulk processing, recipients must grant access with allowBulk: true when calling grantAccess on the Data Protector SDK.

ts
const 
bulkContacts
= await
web3mail
.
fetchMyContacts
({
bulkOnly
: true,
});

Return Value ​

The result object contains a list of contact objects. Each contact represents one user who previously granted you authorization to send them messages.

ts
import { type 
Contact
} from '@iexec/web3mail';

Contact[]