"open_tracking_settings_active": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
- Computed: true,
+ Default: false,
},
"click_tracking_settings_active": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
- Computed: true,
+ Default: false,
},
"unsubscribe_tracking_settings_active": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
- Computed: true,
+ Default: false,
},
"unsubscribe_tracking_settings_html_footer": &schema.Schema{
Type: schema.TypeString,
Optional: true,
- Computed: true,
+ Default: "\n<br>\n<p><a href=\"%unsubscribe_url%\">unsubscribe</a></p>\n",
},
"unsubscribe_tracking_settings_text_footer": &schema.Schema{
Type: schema.TypeString,
Optional: true,
- Computed: true,
+ Default: "\n\nTo unsubscribe click: <%unsubscribe_url%>\n\n",
},
"require_tls": &schema.Schema{
}
}
+func interfaceToStringTab(i interface{}) []string {
+ aInterface := i.([]interface{})
+ aString := make([]string, len(aInterface))
+ for i, v := range aInterface {
+ aString[i] = v.(string)
+ }
+ return aString
+}
func CreateDomain(d *schema.ResourceData, meta interface{}) error {
mg := meta.(*mailgun.MailgunImpl)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
Wildcard: d.Get("wildcard").(bool),
ForceDKIMAuthority: d.Get("force_dkim_authority").(bool),
DKIMKeySize: d.Get("dkim_key_size").(int),
- IPS: d.Get("ips").([]string),
+ IPS: interfaceToStringTab(d.Get("ips")),
})
if err != nil {
d.Set("unsubscribe_tracking_settings_html_footer", domainTracking.Unsubscribe.HTMLFooter)
d.Set("unsubscribe_tracking_settings_text_footer", domainTracking.Unsubscribe.TextFooter)
+ time.Sleep(20 * time.Second)
+
ipAddress, err := mg.ListDomainIPS(ctx)
+
if err != nil {
- return fmt.Errorf("Error Getting mailgun domain ips for %s: Error: %s", d.Id(), err)
+ return fmt.Errorf("Error Getting mailgun domain ips1 for %s: Error: %s", d.Id(), err)
}
ips := make([]string, len(ipAddress))
for i, r := range ipAddress {
if err != nil {
return fmt.Errorf("Error Getting mailgun credentials for %s: Error: %s", d.Id(), err)
}
-
+
credentials := make([]map[string]interface{}, len(credentialsResponse))
for i, r := range credentialsResponse {
credentials[i] = make(map[string]interface{})