Skip to content

Commit a82d8e9

Browse files
Fix
1 parent e519207 commit a82d8e9

2 files changed

Lines changed: 0 additions & 51 deletions

File tree

include/classes/Messaging.hpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -155,25 +155,6 @@ class Messaging {
155155
const std::string& content,
156156
const std::vector<std::string>& topics = {},
157157
const std::vector<std::string>& targets = {});
158-
/**
159-
* @brief Update an email message by its ID.
160-
* @class updateEmail
161-
*
162-
* This method belongs to the updateEmail class and provides the functionality
163-
* to update the subject and content of an existing email message via the
164-
* Appwrite Messaging API.
165-
*
166-
* @param messageId Unique message identifier
167-
* @param subject New subject of the email
168-
* @param content Updated content/body of the email
169-
* @return JSON response string from the server
170-
* @throws AppwriteException if parameters are invalid or request fails
171-
*/
172-
std::string updateEmail(
173-
const std::string& messageId,
174-
const std::string& subject,
175-
const std::string& content
176-
);
177158

178159
/**
179160
* @brief Updates an existing push notification message.

src/services/Messaging.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -635,33 +635,6 @@ std::string Messaging::deleteMessages(const std::string &messageId) {
635635
}
636636
}
637637

638-
std::string Messaging::updateEmail(
639-
const std::string& messageId,
640-
const std::string& subject,
641-
const std::string& content
642-
) {
643-
if (messageId.empty()) {
644-
throw AppwriteException("Missing required parameter: 'messageId'");
645-
}
646-
if (subject.empty()) {
647-
throw AppwriteException("Missing required parameter: 'subject'");
648-
}
649-
if (content.empty()) {
650-
throw AppwriteException("Missing required parameter: 'content'");
651-
}
652-
653-
std::string url = Config::API_BASE_URL + "/messaging/messages/email/" + Utils::urlEncode(messageId);
654-
655-
std::string payload = R"({"subject":")" + Utils::escapeJsonString(subject) +
656-
R"(","content":")" + Utils::escapeJsonString(content) + R"("})";
657-
658-
std::vector<std::string> headers = Config::getHeaders(projectId);
659-
headers.push_back("X-Appwrite-Key: " + apiKey);
660-
headers.push_back("Content-Type: application/json");
661-
662-
std::string response;
663-
int statusCode = Utils::patchRequest(url, payload, headers, response);
664-
665638
std::string Messaging::listTargets(const std::string &messageId,
666639
const std::vector<std::string> &queries) {
667640
if (messageId.empty()) {
@@ -693,9 +666,4 @@ std::string Messaging::listTargets(const std::string &messageId,
693666
"\n\nResponse: " + response);
694667
}
695668
}
696-
throw AppwriteException(
697-
"Error fetching message targets. Status code: " + std::to_string(statusCode) +
698-
"\n\nResponse: " + response);
699-
}
700-
}
701669

0 commit comments

Comments
 (0)