One option is to use the API: First, set them to pending, then set them to subscribe. Setting the user to pending will apparently send a confirmation email, but you can ensure confirmation by setting them as subscribed.
I included a Python script below to resubscribe a list of emails
import hashlib
import requests
import time
# Replace these with your API key and List ID
API_KEY = 'cc2355555555555555555555555555-us1'
LIST_ID = 'c555555555'
# Replace this with your datacenter, e.g. 'us6'
DATACENTER = 'us1'
# List of email addresses to resubscribe
email_addresses = ['email@address.com','email2@address.com']
# Get the total number of email addresses
total_addresses = len(email_addresses)
# Loop through email addresses
for index, email in enumerate(email_addresses):
# Create md5 hash of the lowercase email address
email_hash = hashlib.md5(email.lower().encode()).hexdigest()
# API URL to update the member
url = f'https://{DATACENTER}.api.mailchimp.com/3.0/lists/{LIST_ID}/members/{email_hash}'
# Data to update (set status to 'pending' to send opt-in confirmation email)
data_pending = {
'status': 'pending',
'email_address': email
}
# Make a PUT request to update the member to pending
response = requests.put(url, json=data_pending, auth=('anystring', API_KEY))
# Print the response
print(f'Response for {email} (pending): {response.status_code} - {response.text}')
# Optional: Wait for a few seconds before updating the status to subscribed
time.sleep(5)
# Data to update (set status to 'subscribed')
data_subscribed = {
'status': 'subscribed',
'email_address': email
}
# Make a PUT request to update the member to subscribed
response = requests.put(url, json=data_subscribed, auth=('anystring', API_KEY))
# Print the response
print(f'Response for {email} (subscribed): {response.status_code} - {response.text}')
# Calculate and print the progress percentage
progress_percentage = (index + 1) / total_addresses * 100
print(f'Progress: {progress_percentage:.2f}%')