小编Ant*_*nik的帖子

如何通过MailChimp 3.0 api发送电子邮件?

我试图通过mailchimp api 3.0版在php中发送电子邮件,但我没有运气.这是我的代码:

$postString = '{
        "message": {
            "html": "this is the emails html content",
            "text": "this is the emails text content",
            "subject": "this is the subject",
            "from_email": "xxx@dyyy.sk",
            "from_name": "John",
            "to_email": "aaa.bbb@gmail.com",
            "to_name": "Anton",
            "track_opens": false,
            "track_clicks": false
        }}';

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $this->api_endpoint);
        curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 
        curl_setopt($ch, CURLOPT_USERPWD, 'drewm:'.$this->api_key);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/vnd.api+json', 'Content-Type: application/vnd.api+json'));
        curl_setopt($ch, CURLOPT_USERAGENT, 'DrewM/MailChimp-API/3.0 (github.com/drewm/mailchimp-api)');
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_ssl);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, …
Run Code Online (Sandbox Code Playgroud)

php email send mailchimp

11
推荐指数
2
解决办法
3万
查看次数

AWS-Amplify:此身份池不支持未经身份验证的访问

我正在使用:https : //github.com/aws-amplify/amplify-js

是否有任何工作示例如何使用经过身份验证的 AWS 访问?我正在使用这个:

Amplify.configure({
        Auth: {
            identityPoolId: configs.broker.identityPoolId,
            region: configs.broker.aws_pubsub_region,
            userPoolId: configs.broker.userPoolId,
            userPoolWebClientId: configs.broker.userPoolWebClientId,
        }
});

Amplify.addPluggable(new AWSIoTProvider(configs.broker));

Auth.signIn(configs.broker.username, configs.broker.password)
    .then(user => {                
        resolve({ code: 200, message: 'Authorized access to AWS is used' })
    })
    .catch(singInErr => resolve({ code: 500, message: singInErr.message }));
Run Code Online (Sandbox Code Playgroud)

如果没问题(没问题):

    PubSub.publish(configs.broker.topic, JSON.stringify(data))
         .then(res => resolve({
              code: 200,
              message: 'OK'
         }))
         .catch(err => resolve({
              code: 500,
              message: err.toString()
         }));
Run Code Online (Sandbox Code Playgroud)

但我不断得到:

[未处理的承诺拒绝:NotAuthorizedException:此身份池不支持未经身份验证的访问。]

react-native aws-amplify cognito

7
推荐指数
1
解决办法
3457
查看次数

如何在Easy Admin Bundle中的字段中编辑json数据?

我有这样的数据表:

在此输入图像描述

我想以一些用户友好的形式编辑json数据,不是这样的:

在此输入图像描述

它可以快速完成,只是为了改变一些参数?

forms json symfony symfony2-easyadmin

5
推荐指数
1
解决办法
1681
查看次数

如何在easyadminbundle中设置日期时间选择器的格式?

如何更改easyadminbundle的日期时间选择器使用的默认格式?

我知道我必须config.yml在字段属性的type_options中更改一些内容.或者设置一些不同的日期时间格式.但是如何或在哪里?

在此输入图像描述

datetimepicker symfony symfony2-easyadmin

3
推荐指数
2
解决办法
4117
查看次数