twisted1919 / mailwizz-php-sdk Goto Github PK
View Code? Open in Web Editor NEWmailwizz-php-sdk
Home Page: https://www.mailwizz.com
mailwizz-php-sdk
Home Page: https://www.mailwizz.com
Hi,
I don't find the call to reconfirm someone that unsubscribed to our newsletter:
https://github.com/twisted1919/mailwizz-php-sdk/blob/master/MailWizzApi/Endpoint/ListSubscribers.php
Something like that?
'url' => $this->getConfig()->getApiUrl(sprintf('lists/%s/subscribers/%s/subscribe', (string)$listUid, (string)$subscriberUid)),
?
hello ,
when i create subscription it gives me this error "Invalid API request signature. Please refer to the documentation".
i have used Mailwizz php-sdk for create lists,campaign.All are getting created successfully except only subscriber is not getting created.
I am using Lumen framework.
this is my code for creating subscription->
// CREATE THE ENDPOINT
$endpoint = new \MailWizzApi_Endpoint_ListSubscribers();
// ADD SUBSCRIBER
$response = $endpoint->create($list_uid, array(
'EMAIL' =>'[email protected]', //$data['email'], // the confirmation email will be sent!!! Use valid email address
'FNAME' => 'ABC',
'LNAME' => 'XYZ'//$data['name']
));
var_dump($response);exit;
This is my construct function
public function __construct() {
// configuration object
$this->config = new \MailWizzApi_Config(array(
'apiUrl' => config('api_c.apiUrl'),
'publicKey' =>config('api_c.publicKey'),
'privateKey' => config('api_c.privateKey'),
// components
'components' => array(
'cache' => array(
'class' => 'MailWizzApi_Cache_File',
'filesPath' => dirname(__FILE__) . '/../../../vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Cache/data/cache', // make sure it is writable by webserver
)
),
));
// now inject the configuration and we are ready to make api calls
\MailWizzApi_Base::setConfig($this->config);
MailWizzApi_Autoloader::register();
}
When i dump client request ->
object(MailWizzApi_Http_Client)#2191 (11) {
["paramsGet"]=>
object(MailWizzApi_Params)#2184 (2) {
["_data":"MailWizzApi_Params":private]=>
array(0) {
}
["_readOnly":"MailWizzApi_Params":private]=>
bool(false)
}
["paramsPost"]=>
object(MailWizzApi_Params)#2194 (2) {
["_data":"MailWizzApi_Params":private]=>
array(3) {
["EMAIL"]=>
string(24) "[email protected]"
["FNAME"]=>
string(6) "ABC"
["LNAME"]=>
string(5) "XYZ"
}
["_readOnly":"MailWizzApi_Params":private]=>
bool(false)
}
["paramsPut"]=>
object(MailWizzApi_Params)#2196 (2) {
["_data":"MailWizzApi_Params":private]=>
array(0) {
}
["_readOnly":"MailWizzApi_Params":private]=>
bool(false)
}
["paramsDelete"]=>
object(MailWizzApi_Params)#2197 (2) {
["_data":"MailWizzApi_Params":private]=>
array(0) {
}
["_readOnly":"MailWizzApi_Params":private]=>
bool(false)
}
["headers"]=>
object(MailWizzApi_Params)#2198 (2) {
["_data":"MailWizzApi_Params":private]=>
array(0) {
}
["_readOnly":"MailWizzApi_Params":private]=>
bool(false)
}
["url"]=>
string(69) "http://massmail.xxxxx.com/api/lists/aq39684ebr853/subscribers"
["timeout"]=>
int(30)
["signRequest"]=>
bool(true)
["getResponseHeaders"]=>
bool(false)
["enableCache"]=>
bool(false)
["method"]=>
string(4) "POST"
}
I got following response from server-
object(MailWizzApi_Http_Response)#2204 (11) {
["url"]=>
string(69) "http://massmail.xxxxx.com/api/lists/kh966r7z84cb9/subscribers"
["headers"]=>
NULL
["contentType"]=>
string(31) "application/json; charset=UTF-8"
["httpMessage"]=>
string(11) "Bad Request"
["curlCode"]=>
int(0)
["curlMessage"]=>
string(0) ""
["storeCurlInfo"]=>
bool(false)
["curlInfo"]=>
NULL
["body"]=>
object(MailWizzApi_Params)#2202 (2) {
["_data":"MailWizzApi_Params":private]=>
array(2) {
["status"]=>
string(5) "error"
["error"]=>
string(65) "Invalid API request signature. Please refer to the documentation."
}
["_readOnly":"MailWizzApi_Params":private]=>
bool(false)
}
["request"]=>
NULL
["_httpCode":"MailWizzApi_Http_Response":private]=>
int(400)
}
Please help me out .
Thanks in Advance.
how to add attachment while creating campaign using mailwizz php sdk api?
There is no indication anywhere as to how one might generate API keys. Would you mind updating your documentation?
Hi,
Is it possible to get Subscriber ID returned on "create" endpoint? I tried dumping returned data and I can't seem to find in there, any solution where I can get Subscriber ID?
The idea is I wanted to get subscriber ID on newly added user.
Thanks
Hey, it's me bothering again. Is any other blacklist than the one under "Lists" => "Email blacklist" ? Beucase I can only see one email blacklisted and it's not the same as the ones I'm adding thought the API.
Full response
MailWizzApi_Params Object
(
[_data:MailWizzApi_Params:private] => Array
(
[status] => error
[error] => This email address is blacklisted.
)
[_readOnly:MailWizzApi_Params:private] =>
)
I am requesting that the error that is sent back be updated. If the user submits html that does not include html or body tags the error should reflect this.
Hi,
you consider migrating and rewriting some part the code to be compatible also with PHP 7.4 and 8 right now
https://www.php.net/supported-versions.php
An example to use curly brace syntax for accessing array elements and string offsets it's deprecate on 7.4 into MailWizzApi\Json.php and MailWizzApi\Base.php
https://wiki.php.net/rfc/deprecate_curly_braces_array_access
Thanks a lot
I couldn't find an example to create custom lists fields. If there is any, please let me know.
Thanks.
I have written Script to process bounce from PowerMTA log files.
What's my script doing ?
It extract campaign id , subscriber uid from bounce record
My bounce address is [SUBSCRIBER_UID]-[CAMPAIGN_UID]@domain.com
Catch bounce dsn from powermta log files and then split into soft or hard bounce.
Using API call i will "Create a bounce " and it will update on mailwizz data base " mw_campaign_bounce_log "
Mailwizz automatically mark " Hard " bounce as " Blacklisted ". So i never needs to do anything about that.
What are the issues that I have ?
That means if i have 50 customers i have to host 50 scripts or have to edit it each time when they blast. It's difficult / impossible task.
What I tried ?
What are the errors that i'm getting ?
What am i request ?
Is there any way to get generate API key for user admin that we can handle each and every customer campaigns from it ? ( API key for backend ? )
or How can i get import my data into table "mw_campaign_bounce_log" without using API ?
I am using unsubscribeByEmailFromAllLists / unsubscribeByEmail / unsubscribe when processing bounces through Port25 and other mechanisms. Is there an option where unsubscribes can be marked as a "bounce" and this then be attributed to running campaigns?
How can I disable the confirmation email that gets sent to subscribers when they get added to a list? I don't see any examples of how to set it to single opt-in or anything that would accomplish this.
Curly brace syntax for accessing array elements and string offsets has been deprecated in PHP 7.4.
Fix: change $asSetterName{0} to $asSetterName[0]
mailwizz-php-sdk/MailWizzApi/Base.php
Line 253 in 32c1d10
How can I integrate this to an iOS app? Could you give some examples? =) Thanks!
Hi, i'm developing a module to integrate our crm with mailwizz and i successfully integrate de create customer function.
Is it possibly to add a function to terminate an account with the email address using the API.
Thanks
hello ,
i want to track campaign and i have got following code
// Track subscriber click for campaign click
$response = $endpoint->trackUrl('CAMPAIGN-UNIQUE-ID', 'SUBSCRIBER-UNIQUE-ID', 'URL-HASH');
what is URL-Hash field and what value should i pass for same?
If you follow example customers.php file it register a user without default group and also register as an active customer rather pending-confirm.
Can you look into this and update the SDK?
thanks
The MailWizz API adds the same email multiple times.
This is my code for adding an email:
//MailWizz require_once dirname(__FILE__) . '/mailwizz.init.php'; $endpoint = new MailWizzApi_Endpoint_ListSubscribers(); //App New Users $response = $endpoint->create('wj730zl99w094', array( 'EMAIL' => $email ));
Doesn't MailWizz automatically check if a subscriber is already added and if so, not add that subscriber again?
"error":"Invalid API request signature. Please refer to the documentation."
am testing the examples but sounds like signing is not being done successfully, also the python documentation is removed
hello,
when i create audience and while creating around 700-800 subscribers, it is taking time like 10-15min. so i want to create bulk subscribers because we have more than 10k subscribers and so want to reduce the time on server.
is that possible using php sdk?
Thanks in Advance.
Hello there,
I want to create an API for the MailWizzApi_Endpoint_ListSegments endpoint, for that, I have added the below code and getting an error reponse, Please review it and let me know if I am doing wrong.
class MailWizzApi_Endpoint_ListSegments extends MailWizzApi_Base
{
/**
* Create a new subscriber in the given list
*
* @param string $listUid
* @param array $data
* @return MailWizzApi_Http_Response
* @throws Exception
*/
public function create($listUid, array $data)
{
$client = new MailWizzApi_Http_Client(array(
'method' => MailWizzApi_Http_Client::METHOD_POST,
'url' => $this->getConfig()->getApiUrl(sprintf('lists/%s/segments', (string)$listUid)),
'paramsPost' => $data,
));
return $response = $client->request();
}
}
Passing Request -
URL - http://localhost/mailwizz/features/list_segments.php?listUid=kq918octzy43a
Parameters -
{"ListSegment":{"name":"segment1","operator_match":"all"}}
Response-
Array
(
[status] => error
[error] => Page not found.
)
Thanks in advance.
Sorry for not asking this on the forums, but a third party has access to our MailWizz key, so I am unable to make an account.
I am currently implementing the API/SDK into our software, and I would like to be able to get the clicks, opens, bounces, and unsubscribes from a campaign. When using the Campaigns endpoint, it returns information such as "name", "type", "status", etc., but no opens/bounces/unsubs. CampaignsTracking allows me to get this information, but only passing in a subscriber ID, which is unhelpful because at that stage I will not know who has opened the emails. I can see the information clearly shown when I click on a certain campaign in the web panel, but cannot seem to find a way to export that data. Is there something I am missing, or is this not possible at this time? I may or may not be able to get access to the MailWizz files via SSH, so I would prefer a route that doesn't have me making my own server-side controllers.
Is there any way to add an email to the email blacklist? Does unsubscribeByEmailFromAllLists add that email to the blacklist or just unsubscribe to all currently subscribed lists?
I'm getting a forbidden error when I try to delete a list.
I confirmed It exists and I also tried to delete one manually and worked. I've tried with 50 different lists and I always got the same response.
MailWizzApi_Params Object ( [_data:MailWizzApi_Params:private] => Array ( [status] => error [error] => Forbidden ) [_readOnly:MailWizzApi_Params:private] => )
Please update SDK, example to meet new mailwizz feature like Preheader,Actions against subscribers upon campaign open, Change subscriber custom field value upon campaign open, Max. subscribers, Randomize subscribers, Send this campaign only to subscribers that have opened or have not opened a certain campaign...
Thanks
Hey there,
I have the extended license and wanted to change the class names (MailWizzApi_{NAME}) to something different.
I used Sublimes Replace function but it seems to break everything because it tells me:
MacBook-Pro:examples torstenhogel$ php lists.php
Fatal error: Uncaught Error: Class 'GoMailApi_Config' not found in /Users/torstenhogel/Library/CloudStorage/iCloud Drive/Documents/gomail-php-sdk/examples/setup.php:23
Stack trace:
#0 /Users/torstenhogel/Library/CloudStorage/iCloud Drive/Documents/gomail-php-sdk/examples/lists.php(11): require_once()
#1 {main}
thrown in /Users/torstenhogel/Library/CloudStorage/iCloud Drive/Documents/gomail-php-sdk/examples/setup.php on line 23
I've also tried running cleanups via composer like cache e.g. but it didn't work.
Do you have any idea why this happens?
You have many instances where you're accessing the array using curly braces.
Fix: Replace the {} with [] when you're accessing array elements.
mailwizz-php-sdk/MailWizzApi/Json.php
Line 166 in cb86160
Hi there,
is it possible to extend method https://github.com/twisted1919/mailwizz-php-sdk/blob/master/MailWizzApi/Endpoint/Templates.php#L30 so that we can pass in a template name and it then does a partial match/return of results (same as what the front end does).
I followed the instructions and didn't understand the installation part. Can I get the explanation in brief?
Hello,
Was trying to use the SDK to processs bounce handling via mailwizz api
I am just confused where to put below "exmaples" files or directory where in mailwizz installation ?
https://github.com/twisted1919/mailwizz-php-sdk/tree/master/examples
I am unable to use mailwizz api and no where i am finding guide to setup / install
Please guide me with steps
I want to make my mailwizz api to work
Thanks
Kamlesh
Would be great if you would add a composer file
https://getcomposer.org/
https://github.com/twisted1919/mailwizz-php-sdk/blob/master/MailWizzApi/Http/Request.php#L126
The application seems to purposefully break HTTPS by disabling certificate verification - validating the certificate is critical to guarantee the security of HTTPS. Given that trusted certificates are freely obtainable from Let's Encrypt, adding this as a workaround to allow self-signed certificates seems dubious.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.