for (RecipientsListEntity recipientsList : mailQ.getRecipientsLists()) {
System.out.println(recipientsList.getName());
}
This will list all recipients list which contains given e-mail address.
for (RecipientsListEntity recipientsList : mailQ.getRecipientsListsByEmail("john.doe@example.org")) {
System.out.println(recipientsList.getName());
}
RecipientsListEntity recipientsList = mailQ.getRecipientsList(1L);
System.out.println(recipientsList.getName());
RecipientsListEntity recipientsList = new RecipientsListEntity();
recipientsList.setName("Customer list")
.setDescription("Eshop customers")
.setVariables("gender","name")
.setFormVisible(false);
recipientsList = mailQ.createRecipientsList(recipientsList);
System.out.println(recipientsList.getId());
mailQ.deleteRecipientsList(1L);
Be careful! This will delete recipients list even if it contains entries
mailQ.deleteRecipientsList(1L,true);
List<RecipientsListEntryEntity> recipientsListEntryEntityList = new ArrayList<>();
RecipientsListEntryEntity recipientsListEntry = new RecipientsListEntryEntity();
recipientsListEntry
.setEmail("john.doe@example.org")
.addData("gender","male")
.addData("name", "John");
recipientsListEntryEntityList.add(recipientsListEntry);
recipientsListEntry = new RecipientsListEntryEntity();
recipientsListEntry
.setEmail("jill.doe@example.org")
.addData("gender","female")
.addData("name", "Jill");
recipientsListEntryEntityList.add(recipientsListEntry);
mailQ.addRecipientsToList(324L,recipientsListEntryEntityList);
for (RecipientsListEntryEntity entry : mailQ.getRecipientsFromList(1L)) {
System.out.println(entry.getEmail());
}
RecipientsListEntryEntity recipientsListEntry = new RecipientsListEntryEntity();
recipientsListEntry
.setEmail("john.doe@example.org")
.addData("gender","male")
.addData("name", "John");
mailQ.updateRecipientFromList(324L,recipientsListEntry);
mailQ.deleteRecipientFromList(1L,"john.doe@example.org");
for (UnsubscriberEntity unsubscriber : mailQ.getUnsubscribers(1L)) {
System.out.println(unsubscriber.getEmail());
}
mailQ.unsubscribe(1L,"john.doe@example.org","jill.doe@example.org");
UnsubscriberEntity unsubscriber = mailQ.getUnsubscriber(324L,"john.doe@example.org");
System.out.println(unsubscriber.getEmail());
mailQ.deleteUnsubscriber(1L,"john.doe@example.org");